[erlang-questions] Best practice to hot update .hrl

mats cronqvist masse@REDACTED
Wed Jan 7 15:08:55 CET 2009


"Kaiduan Xie" <kaiduanx@REDACTED> writes:

> "In this respect, proplists or dicts are much better if you can live with the
> (modest) performance hit."

  a record is really a tuple.

-define(rec,{a="A",b="B"}).
 Rec = #rec{}.

  In this case, Rec will be {rec,"A","B"}.

  If you change the record definition, and there is a old version of
Rec hanging around somewhere (e.g. in Mnesia, on another node, on the
stack), you can't access ANY field in that record using the record
syntax(*).

  Real dicts obviously does not have this problem.

  mats

(*) unless you have a module for each version of the record, and no
two record versions have the same length. This "solution" is of course
completly idiotic.



More information about the erlang-questions mailing list