Front page | perl.perl6.language |
Postings from March 2005
Re: s/true/better name/
Thread Previous
|
Thread Next
From:
Luke Palmer
Date:
March 16, 2005 10:31
Subject:
Re: s/true/better name/
Message ID:
20050316183319.GB7258@navi.cx
Marcus Adair writes:
> Additionally I question whether this is truly a case improving to the
> point of least surprise? After all, I don't know a programmer who's
> going to be surprised by what true means. There are still *some* things
> you may have to learn in software dev 101 ;)
The problem is this (common) one:
if answer() == true {
# do something
}
We want to give the programmer no good way to do that, because it's
wrong.
Either that, or we could define true to be the disjunction of all things
true. Then that would work correctly, even when answer() is returning
something more interesting than a bare bool.
Luke
Thread Previous
|
Thread Next