On Jun 27, 7:01 am, Ben Bleything <b... / bleything.net> wrote:
>
> How is it undependble, and what is the failure?
>
> Ben
well, I guess it works, but
I find it undependable in the fact that it is not actually doing what
I expect. I expect that it will tell me if a variable has been, well,
defined as a variable. In the case of the unused variable "y", I
expect that it would tell me that the variable "y" has not been used.
What I get back is the fact that "y" is a method. That has some useful
aspects, but it is not what I am after or what I expected.

Possibly I simply have inaccurate expectations. For whatever reason, I
expect a method/keyword that ends in "?" to return a boolean. (which
is probably just my imagination)

In reality, I don't really need to use defined?, I just wanted to
understand why "defined?(y)" was not returning nil, and that has been
answer.

I am somewhat forming my opinion on the discussion here:
http://redhanded.hobix.com/inspect/methodCheckDefined.html

Were Why the Lucky Stiff says:

"At heart, the defined? keyword is something of a hack, a rather rare
anomaly in Ruby√‘ syntax. Since an undefined variable is a perfectly
legal argument, the defined? keyword couldn√’ be implemented as a
method. Which means that this keyword is left out of Ri documentation.
The Pickaxe groups it with operators. So, it often gets overlooked."

Thanks all.