[erlang-questions] Here's hoping we get frames or structs in 2009!

mats cronqvist masse@REDACTED
Mon Jan 19 10:10:44 CET 2009

Robert Virding <rvirding@REDACTED> writes:

> Something like this could be done for a struct/frame but have a special data
> type. In that case it would look like a record but there the "name" field
> would be a descriptor showing which fields there are and where in the "tuple"
> they are. There would be no need to keep anything in an ets table.

  i've been playing around with a data structure like this. "Anonymous
  records", tuples where the first element is a fun describing the
  fields. E.g.


  where F = fun(a)->2;

  Then this;


would be 

  element((element(1,AR))(a),AR) == "A"


f(AR#{a="A"}) ->

would be

f(AR) when element((element(1,AR))(a),AR)=="A" ->



More information about the erlang-questions mailing list