[erlang-questions] tail-recursive functions

Vlad Dumitrescu vladdu55@REDACTED
Thu Jan 29 12:35:23 CET 2009


Reading the new EEP 26 "Make andalso and orelse tail-recursive" (which
I'm in favor for, btw) made me think of a side-effect: it will become
less easy to see if a function is tail-recursive or not.
I mean, one has to actively look at the operator and decide "it's
andalso, it's tail-recursive" or "it's and, it's not tail-recursive".
In addition, there were discussions about making other constructs
tail-recursive too.

So I wonder if it wouldn't be useful to add a compiler flag that will
make it output warnings about functions that are not tail-recursive?
Or something else, amounting to the same result.

Alternatively, have a separate tool to check this (maybe even
dialyzer, since it is a kind of static analysis).

best regards,

More information about the erlang-questions mailing list