From: Robert Dober Date: 2007-03-13T00:17:09+09:00 Subject: Re: #define alternative for Ruby On 3/12/07, Tim Hunter wrote: > 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. Sorry I was focused on the original idea, I understand your remark now, thx for clarifying. Robert > > -- > Posted via http://www.ruby-forum.com/. > > -- We have not succeeded in answering all of our questions. In fact, in some ways, we are more confused than ever. But we feel we are confused on a higher level and about more important things. -Anonymous