From 510744ce5b0928b0133d7f4abb8dd50063199bbf Mon Sep 17 00:00:00 2001 From: LemonBoy
Date: Thu, 28 Apr 2016 11:11:46 +0200 Subject: [PATCH] Change how unbound variables are checked for. To: address@hidden The previous method checks if the object 'x' we want to check is equal to the value contained in the first slot of a symbol that's supposed to always be undefined. This patch replaces the code above with the use of the C_boundp and C_unboundvaluep macros with no functional effect. --- csi.scm | 2 +- eval.scm | 1 - extras.scm | 2 +- library.scm | 5 ++--- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/csi.scm b/csi.scm index 5466deb..65ec3fe 100644 --- a/csi.scm +++ b/csi.scm @@ -621,7 +621,7 @@ EOF ((bignum? x) (fprintf out "exact large integer ~S~% #x~X~% #o~O~% #b~B~%" x x x x) ) - ((eq? x (##sys#slot '##sys#arbitrary-unbound-symbol 0)) + ((##core#inline "C_unboundvaluep" x) (fprintf out "unbound value~%") ) ((flonum? x) (fprintf out "inexact rational number ~S~%" x)) ((ratnum? x) (fprintf out "exact ratio ~S~%" x)) diff --git a/eval.scm b/eval.scm index b426d11..3cad605 100644 --- a/eval.scm +++ b/eval.scm @@ -209,7 +209,6 @@ (let ([write write] [reverse reverse] [with-input-from-file with-input-from-file] - [unbound (##sys#slot '##sys#arbitrary-unbound-symbol 0)] [display display] ) (lambda (exp env se #!optional cntr evalenv static) diff --git a/extras.scm b/extras.scm index 6f0455c..c04f9ef 100644 --- a/extras.scm +++ b/extras.scm @@ -359,7 +359,7 @@ [else (out (make-string 1 obj) col)] ) ) ) ) ((##core#inline "C_undefinedp" obj) (out "#