tags:

views:

65

answers:

2

I have tried :

c(module_name).

: but this only works from the shell, and gives an error when I try to run it from within a module.

+3  A: 

If you want exactly that behaviour, c:c(module_name) will call the same function called by the shell. I would hesitate to put code that calls user_default (c) functions in production code, so you might want to look at the source for the function and replicate it in your own code so you don't get bitten by a behaviour change in a future erlang release.

archaelus
brilliant! that worked. Thanks
Zubair
+1  A: 

You might want to have a look to the compile module and to the compile:file/2 function in specific.

Roberto Aloi