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

maplist and lists



    Date: Tue, 6 Jan 87 11:35 EST
    From: David C. Plummer <DCP@QUABBIN.SCRC.Symbolics.COM>

	Date: Tue, 6 Jan 87 11:07 EST
	From: Brad Miller <miller@ACORN.CS.ROCHESTER.EDU>

    What do you want
	    (maplist #'list '(1 2 3 . 4) '(a b . c) '(x y z w q r s))
    to return, and why?  What I'm asking for is your "well defined"
    definition.

(((1 2 3 . 4) (a b . c) (x y z w q r s))
 ((2 3 . 4) (b . c) (y z w q r s))
 ((3 . 4) c (z w q r s)))

since there are no further cdr's of the middle form that would be it!

One can argue that
w/o dotted lists one can continue to take cdrs (getting nil) until all lists
are ended, but using a dotted list, you "wave" that - one of the lists
finished, so there are no further maps to be done. Note that this is not a
problem it might be with MAPCAR, where a lot of information might be
(silently) lost, though the same principle could apply...

Brad Miller
------
miller@cs.rochester.edu
miller@acorn.cs.rochester.edu
miller@rochester.arpa