From: Farhad Farzaneh Date: 2010-02-19T10:48:28+09:00 Subject: Re: Ruby conditionals subtlety? Ryan Davis wrote: > On Feb 18, 2010, at 16:04 , Farhad Farzaneh wrote: > >>> yet, and hasn't affected the lookup tables. >> value. As such, if we're ever going to use defined? as a conditional, >> it should precede any other mention of the token (foo). > > I should also point out: almost all of this is of no consequence. You > almost never use defined? on a local variable like this. You usually use > it on a const, ivar, cvar, or global, and all of those are unambiguous. Thanks. I sometimes use it in Rails partials rendering, where I may pass an optional local variable, but if it isn't passed, I want to set it to some default value. Perhaps there's a better way of doing this... -- Posted via http://www.ruby-forum.com/.