Arc Forumnew | comments | leaders | submitlogin
Composing anonymous functions in the form of [..._...] doesn't work
5 points by larme 6141 days ago | 4 comments
For example code like (double:[+ _ 100] 4) raises an error.

However using the macro "compose" defined in arc.arc:130 is ok. Hence I guess the expansion from x:y:z to (compose x y z) is not perfect.



2 points by fail 6141 days ago | link

: Only works in symbols, as ~.

-----

1 point by larme 6141 days ago | link

But f:g is just syntax sugar for (compose f g), and the following code works: ((compose double [+ _ 100]) 4)

Hence i guess after some modification the ":" can support anonymous functions.

-----

4 points by fail 6141 days ago | link

: only works inside symbol names. ~ only works inside symbol names.

-----

3 points by ryantmulligan 6139 days ago | link

Great documentation. For consistency though, I don't see why these things shouldn't work with anonymous functions.

-----