[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] [PATCH] Drop unnecessary boxing of constant-table entr
From: |
Evan Hanson |
Subject: |
[Chicken-hackers] [PATCH] Drop unnecessary boxing of constant-table entries |
Date: |
Mon, 30 May 2016 10:39:38 +1200 |
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).
---
core.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/core.scm b/core.scm
index 688bd79..d3c4c6c 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)
--
2.8.1