[erlang-questions] Auto generated functions

Christian S <>
Tue Feb 5 09:23:57 CET 2008


On Feb 4, 2008 11:39 PM, Attila Babo <> wrote:
> I wrote a simple Y combinator to deal with tail-recursive anonymous
> functions. There are several showcase implementations for Erlang
> already, but for practical purposes you need to deal with arity. Here
> is my code with examples, I'm looking for a way to avoid this
> boilerplate code. For practical reasons it's OK to generate it up to a
> point by hand or use a single tuple as a parameter, but I'm looking
> for "nicer" solution. Any suggestions?

That's the way its done. Only improvement would be to use the
erlang:is_funciton/2 guard. But that is not likely what you were looking for.



More information about the erlang-questions mailing list