nil being empty

D

Devin Mullins

Austin said:
No, that's by simplistic logic. This is *not* a boolean situation; nil
is neither full nor empty. Is zero full or empty? Is a scrambled egg
full or empty?
Full... of yummy goodness!

Devin
The scrambled egg, that is... not the zero.
 
M

M. Edward (Ed) Borasky

Devin said:
Full... of yummy goodness!

Devin
The scrambled egg, that is... not the zero.
Stop him before he sings, "I Got Plenty O' Nuthin'"

:)
 
J

John W. Kennedy

na, read up on godel - every boolean language/situation also has a class of
maybe/unknowable/paradox. this falls there.

Not so. A system has to reach a certain level of complexity for Gödel to
kick in. Arithmetic reaches that level. Boolean algebra does not.
 
A

ara.t.howard

Not so. A system has to reach a certain level of complexity for G=F6del t= o kick=20
in. Arithmetic reaches that level. Boolean algebra does not.

but we're not talking about boolean logic? we're talking about 'statements=
'
made about the concept of nothing in the english language, specifically

nil.empty? # asserting must be either true or false in the thread

and i don't think it's the case that one can say that

((nil.empty? =3D=3D true) -> false) -> true

in otherwords i don't think it's correct to say that, because "making nil
return true for #empty? is the wrong solution" that making it return false =
is
the right one - precisely because we're not dealing with boolean logic here=
=2E

at least, that's my take on something entirely off-thread, but interesting
nonetheless!

cheers.

-a
--=20
in order to be effective truth must penetrate like an arrow - and that is
likely to hurt. -- wei wu wei
 
R

Ross Bamford

Show of hands - who thinks this is bad form?

class NilClass
def empty?; true; end
end

I missed this thread until now, so I'll just raise my hand for the "Nil
is neither empty nor full, so it shouldn't respond_to?:)empty?)" side of
the argument.
 
M

MonkeeSage

Just to throw a wrentch in the clockwork...what would an implementation
of the full? method look like?

Regards,
Jordan
 
H

Hal Fulton

MonkeeSage said:
Just to throw a wrentch in the clockwork...what would an implementation
of the full? method look like?

#full? isn't the complement... it would be #non_empty? or the
equivalent.

Most containers in Ruby aren't "full" unless memory is full.


Hal
 
H

Hal Fulton

Robert said:
Hal said "nil.empty? => true === bad idea"
I thaught that he should have said "nil.respond_to? :empty? === bad idea"
(regardeless of what I think about that matter).

Yes, that is what I meant and should have said.

Of course, even then nil.empty? doesn't return true... or false...
it raises an exception. ;)

So it's still true to say that it doesn't return true.

This is like the Zen master asking the novice when the fire went out,
did it go to the east, west, north, or south?



Hal
 
M

MonkeeSage

Most containers in Ruby aren't "full" unless memory is full.

Semantics, schemantics...what I'm wondering is what the "full?" (or if
you prefer "non_empty?") method would look like. I have a feeling that
it would make a distinction between the value of the *variable* and the
value of the *object*, depending on the context. And if that's true,
then in *some* context, nil.empty? == true is correct. But I've been
known to be silly before, so mabye this is just another instance of
that pattern. ;)

Regards,
Jordan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top