[erlang-questions] Parameterized module idioms
Mikael Pettersson
mikpe@REDACTED
Tue Apr 20 20:40:07 CEST 2010
Mazen Harake writes:
> This boggles me:
>
> If you create a new "instance" of a module with a parameter, then you
> need to have that "instance variable" around to call it right? So you
> need to keep it somewhere... as a state.
>
> So in any case you need to keep a state, in other words you haven't
> achieved anything (except perhaps making your code more obfuscated).
>
> So _why_ is it ["of course"] "easier to use module parameters instead of
> passing closures or state around"?
>
> I must be missing some important detail somewhere...
Consider the parts of the code that uses the module parameters.
More information about the erlang-questions
mailing list