Re: nil != []



On 1/29/06, Alex Polite <notmyprivateemail@xxxxxxxxx> wrote:
>
> On 1/28/06, Stefan Walk <stefan.walk@xxxxxxxxx> wrote:
> > When you get used to it, it's quite handy. Some methods return integers,
> > and false values on failures. If 0 was false, you'd have to distinguish
> > between 0 and false/nil when checking for success.
>

Dynamic typing in Ruby also aids the use of false = false and 0 = 0.

In Java I can't suddenly say that my variable contains a 'False' value. I
would have to make my int = 0 and detect the rationale behind that specific
integer. Dynamic typing solves this because myVariable = 5 and later it can
equal 'false' when it really is false (rather than a
number that represents false)

-Clint


Relevant Pages

  • Re: nil != []
    ... >When you get used to it, it's quite handy. ... >and false values on failures. ... Prev by Date: ...
    (comp.lang.ruby)
  • Re: Calling a method
    ... If a book about failures doesn't sell, is it a success? ... Prev by Date: ...
    (comp.lang.java.help)
  • Re: Adult DVDs - Where to buy?
    ... > Well if you know anywhere cheaper would it not be handy to mention ... > Mark S. ... Prev by Date: ...
    (uk.media.dvd)
  • Re: Lighterweight underwear?
    ... >fly is handy as well. ... What brand and model? ... John ... Prev by Date: ...
    (rec.backcountry)
  • 3 more years!!!
    ... Three more years of grilling incompetent, greedy, dishonest, reckless, ... criminal traitors!!! ... Can Bush survive his final failures? ... Prev by Date: ...
    (alt.politics.bush)