-
|
I'm trying to implement a convenient way to define curried functions. I'd like it to expand like so: I can't quite figure out how to get this working. I tried something like but it tells me the ellipses in the template is misplaced. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Repetitions only work in a “flat” manner, not in a “nested” manner as in your example. Similar to Racket, the way to achieve nesting is through recursion, so there are a couple of approaches here:
I also adjusted a few things: the argument template is changed to The definition form needs to fall back to the expression case in block contexts, so the actual work is lifted to a meta-time function. More things to consider for a full-fledged form:
(Actually, has anyone considered extending |
Beta Was this translation helpful? Give feedback.
Repetitions only work in a “flat” manner, not in a “nested” manner as in your example. Similar to Racket, the way to achieve nesting is through recursion, so there are a couple of approaches here:
recur, likefor/foldr, which is current…