[erlang-questions] Generating a variable in a macro

Thomas Lindgren <>
Wed Jan 10 18:24:34 CET 2007


--- Mats Cronqvist <>
wrote:

>    this is actually exactly why i originally
> proposed exporting a record_info/2 
> function from every module; so that i could write a
> tool to check that all my 
> modules actually DO use the same definition of all
> records.

In many cases, it is likely the answer will be
negative. The record name #state is pretty popular,
for instance ...

Anyway, I'd recommend the short term solution of
browbeating the Dialyzer people into checking how and
where record names are used. Or even checking where
all the regular macros are used -- having different
definitions of interesting ?constants is no good
either.

In fact, maybe this checking can be done simply by
messing around with the preprocessor a bit. Knowing
which files get included where should be a good start,
for instance.

>    i think we can all agree that records suck (as
> does all macros). /.../

(Lisp macros don't suck! :-)

Best,
Thomas



 
____________________________________________________________________________________
Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com



More information about the erlang-questions mailing list