Arc Forumnew | comments | leaders | submitlogin
3 points by almkglor 6101 days ago | link | parent

By this I think you mean:

  [foo bar] => (fn rest (apply foo bar rest))
...?


2 points by cchooper 6101 days ago | link

I'd originally envisioned that the function returned would be more strongly typed (ie. it would expand to (fn (x y z) ...) if foo takes 4 arguments) and that the function would be truly curried, so ([foo bar] baz) would also be a curried function if foo requires more arguments.

Now I think about it, the solution you've given would be perfectly adequate. The function will still fail on the wrong number of arguments, and I almost never need the other feature at all. It would also play friendly with optional and rest arguments.

-----

1 point by almkglor 6101 days ago | link

Hmm. It would be possible to modify 'make-br-fn on the arc-wiki.git for this.

-----