strange mapping
Posted: Tue Jun 14, 2005 5:18 pm
Suppose
=>
Okydoky! That's what I expect. But,
=>
and
=>
Looks like (map n list) means appling (n sublist) instead of (sublist n).
Shouldn't this be the other way around? That and
?
Eddie[/i]
Code: Select all
(define data '((1 2) (2 3) (3 4)))
(println (map first data))
Code: Select all
(1,2,3)
Code: Select all
(println (map 0 data))
Code: Select all
((1 2) (2 3) (3 4))
Code: Select all
(println (map 1 data))
Code: Select all
((2) (3) (4))
Shouldn't this be the other way around? That
Code: Select all
(map 0 data) => (1 2 3)
Code: Select all
(map 1 data) => (2 3 4)
Eddie[/i]