Post-plebiscite issue #3: structure-sharing for mapping

5 views
Skip to first unread message

John Cowan

unread,
May 11, 2013, 1:56:43 PM5/11/13
to scheme-re...@googlegroups.com, scheme-...@scheme-reports.org
In accordance with Will Clinger's posting, Alexey Radul and I are raising
this issue for the WG1 to resolve after the plebiscite is complete.
I document it now so that WG1 members can discuss it now.

Alexey writes:

> - Do map and friends [pp.50-51] always return newly allocated results?
> For example, it's not too hard to write an otherwise-valid
> definition of map where
> (let ((one '(1 6 1 8 0 3))
> (two '(1 4 1 4 2 1)))
> (eqv? one (map (lambda (x y) x) one two)))
> ==> #t
> and one might even want that, to save space. There are of course
> more complicated examples where the result of a map could share list
> structure with the tail of one of its inputs, as long as the
> procedure being mapped returned those elements unchanged.

Currently, the draft just says "returns a list", "returns a string", and
"returns a vector", without saying "newly allocated". I believe nothing
needs to be added. Does any WG1 member disagree? Does any member of
the Scheme community disagree? Silence gives consent.

--
He played King Lear as though John Cowan <co...@ccil.org>
someone had played the ace. http://www.ccil.org/~cowan
--Eugene Field

Arthur A. Gleckler

unread,
May 11, 2013, 7:22:02 PM5/11/13
to scheme-re...@googlegroups.com, scheme-reports
On Sat, May 11, 2013 at 10:56 AM, John Cowan <co...@mercury.ccil.org> wrote:
 
Currently, the draft just says "returns a list", "returns a string", and
"returns a vector", without saying "newly allocated".  I believe nothing
needs to be added.  Does any WG1 member disagree?  Does any member of
the Scheme community disagree?  Silence gives consent. 

It's a reasonable clarification, but I'm okay either way. 

Reply all
Reply to author
Forward
0 new messages