This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: for-each readable-scheme interpreter bug
- From: Per Bothner <per at bothner dot com>
- To: Khairul Azhar <kazar1my at yahoo dot co dot uk>
- Cc: kawa at sources dot redhat dot com
- Date: Mon, 23 Sep 2002 22:31:20 -0700
- Subject: Re: for-each readable-scheme interpreter bug
- References: <20020924032559.31444.qmail@web13709.mail.yahoo.com>
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)