Question: A recent suggestion to ruby was to have all
defined?
method's return true or nil.
So my question is...does anybody ever use "defined?" for anything
besides true/nil?
I also wonder if the complex defined? api explains why this code:
assert(defined?(a) and defined?(b))
throws a syntax error for some reason.
Any thoughts welcome.
Take care.
-Roger
Question: A recent suggestion to ruby was to have all
defined?
method's return true or nil.
So my question is...does anybody ever use "defined?" for anything
besides true/nil?
It looks like I'm missing something... What's the "defined? api"?
Question: A recent suggestion to ruby was to have all
defined?
method's return true or nil.
Let me turn this around.
Why care that it returns truth values other than literal true?
The interpretation of objects as truth values is consistent within
ruby, defined? is one of cases in which that is used to advantage to
convey additional information.
So my question is...does anybody ever use "defined?" for anything
besides true/nil?
Sure, it's useful to know that the syntactic properties of an
expression are dynamically.
···
On 10/13/07, Roger Pack <rogerpack2005@gmail.com> wrote:
in ruby you can do
defined? local_variable_name
or defined? ClassName
or what not and it tells you if those things exist.
mortee wrote:
···
Roger Pack wrote:
Question: A recent suggestion to ruby was to have all
defined?
method's return true or nil.
So my question is...does anybody ever use "defined?" for anything
besides true/nil?
It looks like I'm missing something... What's the "defined? api"?