[plt-scheme] symbols redefined in SRFIs

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Oct 23 20:53:39 EDT 2006

On Oct 24, Dan Muresan wrote:
> Thanks for the detailed analysis.
> 
> > The `map' and `for-each' cases are slightly more
> > tricky. MzScheme's `map' reports an error when the argument lists
> > are not all the same length, whereas SRFI-1's variants allow
> > it. In those cases, the change to MzScheme's versions may be
> > undesirable; I'm not sure.
> 
> Matter of taste, and it has been debated in R6RS. I personally like
> 
> (let ((delta (circular-list 0 1)))
>   (map + delta ls))
> 
> as a way to increment every other element of ls.

You're lumping two *independent* features:

* Should `map' work on lists of different lengths?

* Should `map' work on circular lists?

I'd be surprised if srfi-1's `map' gives you the second.  It certainly
looks like it doesn't:

  (map add1 '#0=(1 . #0#))
  ;; ...loops

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.