unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* early termination for `map'
@ 2011-05-05 15:24 Andy Wingo
  2011-05-05 15:56 ` Noah Lavine
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Andy Wingo @ 2011-05-05 15:24 UTC (permalink / raw)
  To: guile-devel

Hello,

If you call `map' or `for-each' with more than one list, our versions of
these operators will detect if the lists are of unequal length, and
throw an error in that case.

However, SRFI-1 has long provided an extension to this, to allow for
early termination when any of the lists runs out.  R6RS adopted this,
and it looks like R7RS will ratify that.

So perhaps it's time for us to change as well.

This would also allow us to get rid of the hack in srfi-1.c in which,
when and if GOOPS gets loaded, srfi-1 extends the `map' and `for-each'
primitive generics with its own early-termination code, which in effect
gives early termination to every `map' user, regardless of whether that
module has imported srfi-1 or goops.  Sometimes I think that Mikael put
the Oops in Goops for a reason ;-)

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-05-08 15:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-05 15:24 early termination for `map' Andy Wingo
2011-05-05 15:56 ` Noah Lavine
2011-05-05 16:26 ` Ludovic Courtès
2011-05-05 18:40   ` Andy Wingo
2011-05-05 20:21     ` Ludovic Courtès
2011-05-05 21:12       ` Andy Wingo
2011-05-06 15:41         ` Ludovic Courtès
2011-05-08 15:05         ` ‘map’ and ‘for-each’ written in Scheme Ludovic Courtès
2011-05-08 15:31           ` Andy Wingo
2011-05-05 18:27 ` early termination for `map' Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).