summaryrefslogtreecommitdiffstats
path: root/vm.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-25 07:07:03 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-25 07:07:03 -0700
commit3eca0ce001125b1f7042d2d6fe036f036d0845aa (patch)
tree7ea981fde1b56e0af8d9b015def50b3d06d660e8 /vm.c
parent182edce101eccdeb9da8679f857f096c5e60b7db (diff)
downloadtxr-3eca0ce001125b1f7042d2d6fe036f036d0845aa.tar.gz
txr-3eca0ce001125b1f7042d2d6fe036f036d0845aa.tar.bz2
txr-3eca0ce001125b1f7042d2d6fe036f036d0845aa.zip
compiler: replace "$" package hack.
When compile-file writes emits the file, it does so with *package* bound to a temporary package named "$" so that all the symbols get fully qualified. Problem is, this is a valid package name and is added to the package list. While the package exists, symbols such as $:a could be interned. If such symbols occur in code being compiled, they get emitted using unqualified names. Let's introduce an internal interface for making an anonymous package which isn't on the list of package, and which has a name that results in bad syntax if it occurs in print. * eval.c (eval_init): Register sys:make-anon-package intrinsic. * lib.c (make_package_common): New static function. (make_package): Package construction and initialization code moved into make_package_common. (make_anon_package): New function. * lib.h (make_anon_package): Declared. * share/txr/stdlib/compiler.tl (usr:compile-file): When writing out translation, bind *package* to anonymous package from sys:make-anon-package.
Diffstat (limited to 'vm.c')
0 files changed, 0 insertions, 0 deletions