diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-05-08 11:16:45 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-05-08 11:16:45 -0700 |
commit | 1d5bfd6ebd47444034478bdce836946085ca1367 (patch) | |
tree | 819c492da86117960837eff2322e9f8ffc41573a /tests/011/macros-2.txr | |
parent | 7025b2c547d3611301e3e6fde8422aaba2acfd3f (diff) | |
download | txr-1d5bfd6ebd47444034478bdce836946085ca1367.tar.gz txr-1d5bfd6ebd47444034478bdce836946085ca1367.tar.bz2 txr-1d5bfd6ebd47444034478bdce836946085ca1367.zip |
Crack down on redefinitions of built-ins.
* eval.c (builtin, eval_initing): New global variable.
(op_defun, op_defmacro): During initialization, record functions
and macros in builtin hash.
(builtin_reject_test): New static function.
(expand_macrolet): Perform builtin reject test for fbind, lbind,
and macrolet.
(regfun, reg_mac): Add symbol to builtin hash.
(eval_init): GC-protect new hash table variable and initialize it.
Set eval_initing to true over eval initialization.
The flip function is renamed fo flipargs.
(eval_compat_fixup): New function, for dealing with the
operator/function conflict over flip.
* eval.h (eval_compat_fixup): Declared.
* lib.c (compat_fixup): Call eval_compat_fixup.
* tests/011/macros-2.txr: This test was defining a macro called
while which is now illegal. Renamed to whilst.
* tests/011/macros-2.expected: Regenerated.
* txr.1: Function flip renamed to flipargs and documented in
Compatibility section.
Diffstat (limited to 'tests/011/macros-2.txr')
-rw-r--r-- | tests/011/macros-2.txr | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/011/macros-2.txr b/tests/011/macros-2.txr index 9a53f115..96045ca4 100644 --- a/tests/011/macros-2.txr +++ b/tests/011/macros-2.txr @@ -1,7 +1,7 @@ @(do (set *gensym-counter* 0) - (defmacro while ((condition : result) . body) + (defmacro whilst ((condition : result) . body) (let ((cblk (gensym "cnt-blk-")) (bblk (gensym "brk-blk-"))) ^(macrolet ((break (value) ^(return-from ,',bblk ,value))) @@ -12,7 +12,7 @@ (block ,cblk ,*body))))))) (let ((i 0)) - (while ((< i 100)) + (whilst ((< i 100)) (if (< (inc i) 20) continue) (if (> i 30) @@ -21,7 +21,7 @@ (prinl (sys:expand - '(while ((< i 100)) + '(whilst ((< i 100)) (if (< (inc i) 20) continue) (if (> i 30) @@ -29,8 +29,8 @@ (prinl i)))) (let ((i 0)) - (while ((< i 5)) + (whilst ((< i 5)) (inc i) - (labels ((while () 'while)) + (labels ((whilst () 'whilst)) (let ((break 'break)) - (prinl (list (while) break))))))) + (prinl (list (whilst) break))))))) |