~ chicken-core (chicken-5) 110f539bbc202b6ff4eaa6be8b1ee57180bf8de5


commit 110f539bbc202b6ff4eaa6be8b1ee57180bf8de5
Author:     Evan Hanson <evhan@foldling.org>
AuthorDate: Mon May 30 10:39:38 2016 +1200
Commit:     Peter Bex <peter@more-magic.net>
CommitDate: Tue May 31 19:42:10 2016 +0200

    Drop unnecessary boxing of constant-table entries
    
    Now that "collapsable-literal?" constants are inserted into the
    constants table as quoted values, there's no need to box them in a list
    (which was done to ensure that "#f" isn't treated as a missing entry).

diff --git a/core.scm b/core.scm
index 688bd79f..d3c4c6cc 100644
--- a/core.scm
+++ b/core.scm
@@ -529,7 +529,7 @@
       (d `(RESOLVE-VARIABLE: ,x0 ,x ,(map (lambda (x) (car x)) se)))
       (cond ((not (symbol? x)) x0)	; syntax?
 	    ((##sys#hash-table-ref constant-table x)
-	     => (lambda (val) (walk (car val) e se dest ldest h #f)))
+	     => (lambda (val) (walk val e se dest ldest h #f)))
 	    ((##sys#hash-table-ref inline-table x)
 	     => (lambda (val) (walk val e se dest ldest h #f)))
 	    ((assq x foreign-variables)
@@ -1235,11 +1235,11 @@
 			   (set! defconstant-bindings
 			     (cons (list name `(##core#quote ,val)) defconstant-bindings))
 			   (cond ((collapsable-literal? val)
-				  (##sys#hash-table-set! constant-table name (list `(##core#quote ,val)))
+				  (##sys#hash-table-set! constant-table name `(##core#quote ,val))
 				  '(##core#undefined))
 				 ((basic-literal? val)
 				  (let ((var (gensym "constant")))
-				    (##sys#hash-table-set! constant-table name (list var))
+				    (##sys#hash-table-set! constant-table name var)
 				    (hide-variable var)
 				    (mark-variable var '##compiler#constant)
 				    (mark-variable var '##compiler#always-bound)
Trap