[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Scheme-reports] Post-plebiscite issue #3: structure-sharing for mapping



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 <cowan@x>
someone had played the ace.             http://www.ccil.org/~cowan
        --Eugene Field

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports