3 ms·
Hey Michael, very cool! I liked the support for currying (where you mapped the partial function (+ 10)).
by mark_l_watson 6y ago
Hey Michael, very cool!
I liked the support for currying (where you mapped the partial function (+ 10)).
- hencq 6y agoYeah, the automatic currying looks very nice. I was wondering how that works with optional arguments or rest arguments. At first glance I didn't see anything about that in the tutorial. It seems to me as a layman that auto-currying can only work with fixed arity functions, but I'm curious if that's indeed the case. Edit: I scanned the docs too quickly. It's answered there: > Unlike many Lisps, TL functions always expect a fixed number of arguments. For example, the + function shown above expects to receive 2 arguments and if it receives too many then and error occurs:
- akkartik 6y agoEven cooler: defining a function (and block) relies on currying. I think it's just syntax sugar.
- bjoli 6y agoI am of the opposite view. Mostly because I am world champion at forgetting to apply a function with enough arguments. I think partial applivation should be explicit, at least in dynamic languages where this is not enforced at compile-time.