This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: or evaluates second argument if first is true?


Jim's comments are correct.  It is the implementation of
environment-bound? that is wrong, at least for the current Kawa,
since Environment.lookup can return a Binding that is unbound.

Please try the attached patch.
--
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/
Index: misc.scm
===================================================================
RCS file: /cvs/kawa/kawa/kawa/lib/misc.scm,v
retrieving revision 1.20
diff -u -r1.20 misc.scm
--- misc.scm	18 May 2002 22:40:31 -0000	1.20
+++ misc.scm	30 Sep 2002 01:58:47 -0000
@@ -24,12 +24,10 @@
 (define (values #!rest (args :: <Object[]>))
   (invoke-static <gnu.mapping.Values> 'make args))
 
-(define (environment-bound? env sym)
-  (not (eq? ((primitive-virtual-method "gnu.mapping.Environment" "lookup"
-                                       "gnu.mapping.Binding"
-                                       (<symbol>))
-             env sym)
-       #!null)))
+(define (environment-bound? (env :: <gnu.mapping.Environment>)
+			    (sym :: <String>))
+  :: <boolean>
+  (invoke env 'isBound sym))
 
 ;; The version number is not optiona according to R5RS.
 ;; But since earlier versions of this implementation took 0 arguments,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]