Arc Forumnew | comments | leaders | submitlogin
1 point by almkglor 5942 days ago | link | parent

> but this simple macro does not integrate with defm or pat-m (yet).

It doesn't have to: the 'p-m modifier will adapt to it. All it needs is an args . body somewhere at the end of your macro's arg list - which you do have. p-m will then be able to adapt.



1 point by rincewind 5942 days ago | link

All patterns would have to be of the same length, and ideally they should be ll(1) patterns, so they could dispatch on the first arg. Or should the pattern matching occur after the function got all of its arguments?

What I would really like to see is currying with partial function application and dispatch on every function argument, so that (my-curried-fun (annotate 'foo val)) is evaluated to a curried function for the type foo. Otherwise the (types|patterns) would have to be compared everytime this function is applied, which may be inefficient, e.g in

  (map (my-curried-fun (annotate 'foo val)) my-large-list)
This may be difficult to implement without a change in the interpreter or in p-m and curry/defc.

-----