~ chicken-core (chicken-5) 4c191467803965d725af29d219a578d81b30710f
commit 4c191467803965d725af29d219a578d81b30710f
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Tue May 17 10:41:14 2011 +0200
Commit: felix <felix@call-with-current-continuation.org>
CommitDate: Tue May 17 10:41:14 2011 +0200
resurrected unprefixed lambda node for analysis; handle ambiguity of symbol in value-position of define-constant (thanks to sjamaan)
diff --git a/compiler.scm b/compiler.scm
index e5c7ac5a..d501ed8f 100644
--- a/compiler.scm
+++ b/compiler.scm
@@ -223,7 +223,7 @@
; undefined -> <boolean> If true: variable is unknown yet but can be known later
; value -> <node> Variable has a known value
; local-value -> <node> Variable is declared local and has value
-; potential-value -> <node> Global variable was assigned this value (later turns into 'value)
+; potential-value -> <node> Global variable was assigned this value (used for lambda-info)
; references -> (<node> ...) Nodes that are accesses of this variable (##core#variable nodes)
; boxed -> <boolean> If true: variable has to be boxed after closure-conversion
; contractable -> <boolean> If true: variable names contractable procedure
@@ -1106,7 +1106,8 @@
;; could show line number here
(quit "error in constant evaluation of ~S for named constant ~S"
valexp name)
- (if (collapsable-literal? valexp)
+ (if (and (not (symbol? valexp))
+ (collapsable-literal? valexp))
valexp
(eval
`(##core#let
@@ -1777,8 +1778,18 @@
(walk val env localenv here #f)
(loop (cdr vars) (cdr vals)) ) ) ) ) )
- ((lambda)
- (bomb "somebody used unprefixed `lambda'!"))
+ ((lambda) ; this is an intermediate lambda, slightly different
+ (grow 1) ; from '##core#lambda nodes (params = (LLIST));
+ (decompose-lambda-list ; CPS will convert this into ##core#lambda
+ (first params)
+ (lambda (vars argc rest)
+ (for-each
+ (lambda (var) (put! db var 'unknown #t))
+ vars)
+ (let ([tl toplevel-scope])
+ (set! toplevel-scope #f)
+ (walk (car subs) (append localenv env) vars #f #f)
+ (set! toplevel-scope tl) ) ) ) )
((##core#lambda ##core#direct_lambda)
(grow 1)
Trap