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: for-each readable-scheme interpreter bug


Khairul Azhar wrote:
The following piece of code displays something strange when the output
format "readable-scheme" is used in the interpreter: -

(for-each display (list "one " "two " "buckle my shoe"))
Try the attached patch.

BTW, I'd love to use the CVS version, but only having a dialup connection
+ being a student makes it time-consuming and expensive.
I don't think using CVS should be that time-consuming, at least
if you use compression:

cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/kawa co kawa
--
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/
Index: map.java
===================================================================
RCS file: /cvs/kawa/kawa/kawa/standard/map.java,v
retrieving revision 1.11
diff -u -r1.11 map.java
--- map.java	22 Jul 2002 06:21:54 -0000	1.11
+++ map.java	24 Sep 2002 05:24:32 -0000
@@ -65,7 +65,12 @@
     Procedure proc = (Procedure) (args[0]);
     int arity = args.length - 1;
     if (arity == 1)
-      return map1 (proc, args[1]);
+      {
+	if (collect)
+	  return map1 (proc, args[1]);
+	forEach1 (proc, args[1]);
+	return Values.empty;
+      }
     Object result;
     Pair last = null;
     if (collect)

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