[erlang-questions] Process scope variable
Tue Feb 17 14:58:31 CET 2015
You're asking for trouble here -- global variables will complicate your
code and bring in hard to track errors. On the other hand, carrying few
variables in parameters or carrying a state record will make changes
performed by your code very much visible and easy to track using only your
But anyway, if you very much want that -- process global variables can be
set by erlang:put() and can be read by erlang:get(). Enjoy your heisenbugs.
On Tue, Feb 17, 2015 at 2:55 PM, Imants Cekusins <imantc@REDACTED> wrote:
> Does anyone see any benefit from process scope variables?
> A = 10,
> B = A + 1.
> If unset variable is referenced, an error is raised.
> If set process variable is assigned to (and does not pattern match),
> an error is raised.
> This way, there is no need to pass a bunch of static variables around.
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions