Best practices: get/put
Sun Jan 29 21:02:57 CET 2006
2006/1/29, James Hague <james.hague@REDACTED>:
> I would argue that using put and get is fine, if all you have is a
> simple process that acts as a database. It essentially give you a
> hash table, much like ETS (one of the things I really like about Perl
> and Python is that hash tables are mindlessly simple to use). But you
> don't want to mix puts and gets in with general purpose processing,
> for the reasons others have already stated.
What about using it as lisp's dynamic variables, setting it before a call,
and removing it after using try-after-end.
I see it done sometimes. I realize how it is ugly, but it is oh so handy for
simple low-arity callbacks and yet still have access to lots of state values
in the same dynamic scope.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions