[erlang-questions] Re assigning variables

Richard O'Keefe ok@REDACTED
Thu Mar 19 22:37:27 CET 2009


On 19 Mar 2009, at 11:18 pm, Zvi wrote:
> BTW: I think RoK's ?when macros will not work, b/c if only works  
> with guards
> (also aren't when reserved word too?)

(a) My ?when macro was only *intended* to work with guards.

(b) Since every macro invocation begins with a question mark,
     and since macro names already ignore a major lexical
     distinction in Erlang (namely the difference between atoms
     and variable names) it had never occurred to me that keywords
     would be unusable as macro names.  I regard this as a bug in
     the current implementation of the preprocessor.  If macro
     invocations did *not* begin with '?', then it would be
     important to disallow the use of keywords as macros, but
     really, there's no good reason to forbid ?band as a macro
     just because band is reserved.  That'd be rather like
     forbidding ribband as an atom because band is reserved.





More information about the erlang-questions mailing list