summaryrefslogtreecommitdiff
path: root/module/system/base/syntax.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2008-05-15 18:48:22 +0200
committerAndy Wingo <wingo@pobox.com>2008-05-15 18:48:22 +0200
commitcd702346f263fa38d1638e2512c2c6365611118b (patch)
tree2d709877991d5a7cb72d5d5b72b72836412753f4 /module/system/base/syntax.scm
parent6167de4f72d5aed29a73f3a4e7e6b4bfebe4287a (diff)
downloadguile-cd702346f263fa38d1638e2512c2c6365611118b.tar.gz
fix else in cond, letrec env corruption, syntax.scm compile, define-module side effects
* module/language/scheme/translate.scm (primitive-syntax-table): Translate the `else' clause of a cond as (begin ...). We used to use trans-body, which processes internal defines, which are not legal syntax here. * module/system/base/syntax.scm (define-record): Unfortunately, we can't unquote in the actual procedure for `%compute-initargs', because that doesn't work with compilation. So reference %compute-initargs by name, and export it. * module/system/il/ghil.scm (apopq!): Gaaaaar. The order of the arguments to assq-remove! was reversed, which was the badness, causing corruption to the env after calling call-with-ghil-bindings. Grrrrrr. (fix-ghil-mod!, ghil-lookup, ghil-define): As amply commented in the code, deal with compile-time side effects to the current module by lazily noticing and patching up the compile-time environment. A hacky solution until such a time as we special-case something for `define-module'.
Diffstat (limited to 'module/system/base/syntax.scm')
-rw-r--r--module/system/base/syntax.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/module/system/base/syntax.scm b/module/system/base/syntax.scm
index 488ff3b56..ffdac8414 100644
--- a/module/system/base/syntax.scm
+++ b/module/system/base/syntax.scm
@@ -20,6 +20,7 @@
;;; Code:
(define-module (system base syntax)
+ :export (%compute-initargs)
:export-syntax (define-type define-record record-case))
(export-syntax |) ;; emacs doesn't like the |
@@ -57,10 +58,10 @@
(if (pair? slot)
`(cons ',(car slot) ,(cadr slot))
`',slot))
- slots))))
+ slots)))
+ (constructor (record-constructor ,name)))
(lambda args
- (apply ,(record-constructor type)
- (,%compute-initargs args slots)))))
+ (apply constructor (%compute-initargs args slots)))))
(define ,(symbol-append stem '?) ,(record-predicate type))
,@(map (lambda (sname)
`(define ,(symbol-append stem '- sname)