[erlang-questions] Erlang Syntax - again

Christian S chsu79@REDACTED
Tue Mar 11 12:05:44 CET 2008


> It is misunderstand what record is. Record is not this sort of things. Use
> our own structure for this purpose. Record is not object, hash, dictionary
> or whatever you really want. Record is not designed for some sort of
> inheritance. Record is structure for memory friendly storage of fixed
> "records" a which one will be changed very rare and just only by design.

That is what they are.  What we want might be something else though.


Thinking out loud:

Would it be possible to create a pattern matching syntax for some kind
of association map?

As I understand it, guards without near O(1) properties are not that
popular. But others do exist already.

Perhaps something that recognizes {[Fields::atom()],
FieldValue1::term()} so that
both {[gurka, avocado, sallad, dressing], 1, 2, 3, 4} and {[tacos,
salsa, avocado], 8, 4, 2} could be
matched when asking for avocado=2 in this something.

%% What better character to use for a beta feature than ß !!?
cook(ß{avocado=1}) ->
   guacamole().



The real wart in record _syntax_ is when you update a record in a
record ( in a record ( in a record ...)).



More information about the erlang-questions mailing list