[erlang-questions] Is this code tail recursive?

Alexey Romanov alexey.v.romanov@REDACTED
Fri Sep 17 06:28:37 CEST 2010


On Fri, Sep 17, 2010 at 8:14 AM, Ryan Zezeski <rzezeski@REDACTED> wrote:
> On Mon, Sep 6, 2010 at 6:31 AM, Max Lapshin <max.lapshin@REDACTED> wrote:
>
>>
>> Yes, of course.
>> Do not forget about difference between f() and ?MODULE:f()
>>
>>
> Max, as a newb to Erlang, are you saying that without the module
> qualification and if you imported a function f/0 from another module it
> would instead call that?  Actually, I just went ahead and tried that and the
> compiler gave me an error.  So I ask, what are you referring to?

The difference is that if you change the code of your module while
it's running, ?MODULE:f() will always call the function in the new
version of the module, while f() will call the old version.
See http://spawnlink.com/articles/rules-of-hot-code-swapping/


More information about the erlang-questions mailing list