chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] Remove obsolete and deprecated stuff, fix brea


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] Remove obsolete and deprecated stuff, fix breakage to eval environments caused by removal
Date: Sun, 17 Dec 2017 15:07:35 +0100
User-agent: NeoMutt/20170113 (1.7.2)

Hi all,

The attached set of patches remove several deprecated definitions and
workarounds.  The last patch also introduces what I consider a temporary
workaround to ensure that the initial "eval" environment contains the
definitions from default-imports.

Originally, the initial eval environment was _also_ empty, but something
like (eval '+) happened to work anyway.  I think(!) that this used to
work through ##sys#alias-global-hook; when a symbol was not in the
environment, it is looked up as a global symbol, and because library.scm
had (define + (##core#primitive "C_plus")) at the toplevel, it would
resolve to the correct identifier somewhat by accident.

This is a holdover from the pre-module CHICKEN 3 days, where this was
actually the intended behaviour.  By removing the deprecated calls like
(##core#setslot '+ 0 scheme#+) at the end of library.scm, we lose this
fallback, which reveals the fact that the initial eval environment is
really empty.

The last patch contains a change in batch-driver.scm to "inject" something
like (eval '(import scheme chicken.base chicken.syntax)) into each program.
This _would_ be enough if it weren't for statically linked programs: in
those, you can't load the import library dynamically (you'll get an error).
That's this patch also adds (include "chicken.base.import.scm") and
(include "chicken.syntax.import.scm") to the end of modules.scm.

This last bit is what I think ought to be temporary.  It would be better
to produce a generic way to link specific import libraries into programs.
That would allow the user to create static programs with custom eval
environments containing arbitrary modules.  For instance, if one were to
distribute a statically linked web application, one would want the
identifiers from spiffy, awful and the underlying libs like intarweb and
uri-common to be available to the user in evaluated code; the identifiers
themselves are built into the program anyway, but without the import libs
being available you can't access them unless you're willing to prefix
them with the module name, like "uri-common#uri-reference".

Note that the tests are broken if you apply just one of the patches.
You will also need to build a bootstrapping chicken in order to run
the tests successfully due to the injected imports in batch-driver.scm
which are not available when compiled with an older chicken.

Cheers,
Peter

Attachment: 0001-Remove-obsolete-deprecated-stuff.patch
Description: Text Data

Attachment: 0002-Drop-weird-macro-workarounds-in-favour-of-chicken.in.patch
Description: Text Data

Attachment: 0003-Include-definitions-of-default-modules-into-modules..patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]