[erlang-questions] Why can't I use variables to denote members of a record?

Michael Turner leap@REDACTED
Sun Nov 29 14:24:05 CET 2009


Ulf -

The link from your trapexit entry into the erlang mail archives

  http://forum.trapexit.org/viewtopic.php?p=21790#21790

seems to be dead.

Direct search in mail archives at erlang.org on "exprecs" turns up
messages that link to this same entry at trapexit.org, except for the
first message you wrote on the subject of exprecs

  http://www.erlang.org/cgi-bin/ezmlm-cgi/4/20050

which says that the exprecs.erl code is attached.  But I don't see how
to get that attachment from the archives.

-michael turner


On 11/29/2009, "Ulf Wiger" <ulf.wiger@REDACTED> wrote:

>Tony Arcieri wrote:
>> I ran into a case where it would really be helpful to do:
>>
>> Rec#some_record{Member = Value}
>>
>> And the Erlang preprocessor bitches:
>>
>>[...]
>> Am I the first one in the history of Erlang to desire this behaviour?
>
>Not at all. It has in fact been debated quite a lot over
>the years.
>
>I once wrote a parse_transform called exprecs that offers
>a compromise by letting you 'export' a record, thereby auto-
>generating accessor functions for that record.
>
>http://forum.trapexit.org/viewtopic.php?p=21790#21790
>
>I'm guessing that this won't entirely satisfy your needs,
>but if so, perhaps you can use it as a starting point for
>some similar transformation?
>
>BR,
>Ulf W
>--
>Ulf Wiger
>CTO, Erlang Training & Consulting Ltd
>http://www.erlang-consulting.com
>
>________________________________________________________________
>erlang-questions mailing list. See http://www.erlang.org/faq.html
>erlang-questions (at) erlang.org
>
>


More information about the erlang-questions mailing list