[erlang-questions] LFE - Lisp Flavoured Erlang released
Vlad Balin
gaperton@REDACTED
Wed Mar 12 00:24:49 CET 2008
> Perhaps a stupid question. Do LFE implement currying?
> If not, why?
>
> I want currying... :-)
Not a big deal.
your_curried_func( A ) -> fun( B, C ) -> your_curried_func( A, B, C ) end.
your_curried_func( A, B ) -> fun( C ) -> your_curried_func( A, B, C ) end.
your_curried_func( A, B, C ) -> ...
One extra line for each curring case. For me it's completely ok, but
you can define macro to hide this stuff if it bothers you. You'll get
something like this:
?curried_3( your_curried_func )
your_curried_func( A, B, C ) -> ...
More information about the erlang-questions
mailing list