[erlang-questions] refactoring a very large record
Matthew Sackman
matthew@REDACTED
Thu Oct 20 18:04:22 CEST 2011
On Thu, Oct 20, 2011 at 05:33:52PM +0200, Jesper Louis Andersen wrote:
> There are type systems built for the purpose of tracking such
> properties. See for instance Uniqueness types in the language Clean.
> Thus the types can guarantee an access pattern that means the above
> construction would be a type error. And thus you could destructively
> update Z.
Indeed. Thanks for the illustration. At runtime, if you have pushed
through live variable / reaching analysis, then you might be able to
tag the variable with the number of remaining live pointers to the
variable and thus determine (whether or not == 1) if you can do the
in-place update. Has that been tried in the context of Erlang?
Matthew
More information about the erlang-questions
mailing list