Monthly Archives: December 2008

What sucks about Erlang – Damien Katz

See also comments:

–would there be an issue if “if” was named “guard” (since that’s what it does, evaluates guard clauses, not any conditional expression); and if you could “if … is” as a synonym for “case … of”?


Erlang Parametrized Modules

This is absolutely great but undocumented feature of Erlang language.

In brief:
Basically it is like a class instantiation in OOP. It looks like ModuleInstance=my_module:new(InstanceParams). And then you can call module instance’s methods like ModuleInstance:do_smth() . If module is parametrized -module(my_module, [ModuleParam]). you can not call its’ methods until you create an instance. The difference from OOP class instances though is that calling new with same parameters will return the same instance.