From: Tim Hunter Date: 2007-03-12T21:52:17+09:00 Subject: Re: #define alternative for Ruby Robert Dober wrote: > On 3/12/07, Timothy Hunter wrote: >> >> > Although I am against macros it might be worth pointing out that of > course it can be done > > #define MYDEFINE var val \ > var = val unless defined? var > > forgive me if the syntax is incorrect. > The Ruby interpreter will not see the macro and vice versa. > > BTW on Linux I guess you can always use gcc to preprocess files anyway, > but > STAY AWAY FROM THIS. > > Sorry for shouting, but I wanted to be heared ;) > Cheers > Robert Perhaps we are discussing different kinds of variables. Your macro tests if a given preprocessor symbol is defined or not. Such a symbol must be defined (or not) when the preprocessor runs. Probably the closest analog in Ruby is a global constant. I was talking about variables such as automatics or statics, much closer to Ruby's variables. -- Posted via http://www.ruby-forum.com/.