[erlang-questions] Shell doesn't seem to recognize code changes.

Oscar Hellström oscar@REDACTED
Wed Jan 7 11:40:36 CET 2009


How do you compile the module? If you use erlc or erl -make outside of
the shell you also need to load the new module in the shell. You can do
that by executing l(ModuleName). A module is loaded by the code server
the first time it is used (or at boot in embedded mode) and the loaded
version will be kept until the something (user or program) tells the
code server to reload the module.  If a module is recompiled from the
shell (using c/1 or c/2) the module will also be reloaded.

Ryan Lepidi wrote:
> Hello,
> I am new to Erlang so this is probably some stupid oversight.
> Basically, I have a module that is an implementation of gen_server. I
> start the server in the shell, execute some function, then terminate
> it. My problem is that if I change a function in the module, recompile
> it, and then execute it in the shell again (without closing the shell
> inbetween the compile), the OLD version of the function still remains
> - the only way to get my new functionality is to restart the shell. I
> make sure to terminate the server before starting it up again to test
> the modified function, and I have verified it is indeed stopping with
> processes().
> Am I doing something wrong?
> ------------------------------------------------------------------------
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions

Best regards

Oscar Hellström, oscar@REDACTED
Office: +44 20 7655 0337
Mobile: +44 798 45 44 773
Erlang Training and Consulting

More information about the erlang-questions mailing list