[erlang-questions] Generating a variable in a macro

Thomas Lindgren thomasl_erlang@REDACTED
Tue Jan 9 19:07:42 CET 2007


--- Mats Cronqvist <mats.cronqvist@REDACTED>
wrote:

> Thomas Lindgren wrote:
> > --- Mats Cronqvist <mats.cronqvist@REDACTED>
> > wrote:
> >>    why the record_info functions are not laid out
> in
> >> the beam files (like the 
> >> module_info functions) is a mystery to me. surely
> >> that would be The Right Thing 
> >> (tm).
> > 
> > Well, that might give users the idea that records
> are
> > more than syntactic sugar for tuples. But they're
> not.
> 
>    that sounds pretty weak...

"Records" as used today are declared in include files
which then are textually inserted into one or many
modules. A record declaration does thus not in general
have a unique point of definition. A single record
name #r can also be declared differently in different
modules. There is finally no general way to know that
the tuple {r, foo, 4711} should use the record_info
definition in mod1 or the one in mod2. Or neither.

Just see the record notation as macros. (Which is,
after all, what it is.)

Best,
Thomas

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the erlang-questions mailing list