|
|
|
|
|
by sago
2892 days ago
|
|
I don't know Arc, so this confuses me: arc> (map l '(0 1 2))
(1 2 3)
What is the logic here? Is l made into a function that holds state and returns each element in turn (like an iterator function)? Because I would've expected: arc> (map l '(0 1 2))
((1 2 3) (1 2 3) (1 2 3))
In what way is map being applied here? |
|
> In Arc, data structures can be used wherever functions are, and they behave as functions from indices to whatever's stored there.
(quoted from the Arc tutorial)
So
and so on. So the GP makes sense.