Monday, October 26, 2009

erlang snippet (on windows) - anonymous functions

in erlang you can define an anonymous function the following way:


FUNCNAME = fun(X) -> 10*X end.

and you can use it like this:

FUNCNAME(11).

erlang snippets (on windows) - change directory and compile

change directory:

cd ("c:/erlang/2/").

compile:

c("C:\\Erlang\\1\\helloworld.erl").

or you can change directory and comiple:

cd ("c:/erlang/1/").

c(helloworld).