On 5/29/07, Larry Wall wrote:
Note that "any" is considered a singular noun in English,
I started to say, "Except when it means 'all'", but when used that
way, it still would mean "all" in the singular sense. But it gives
me an excuse to point out that "any" can be ambiguous in English;
it's not hard to see which meaning is intended in a given context,
but there's still a temptation to translate an English "any" into a
Perl "any" when it really means "all".
#If my score equals anyone else's, there's a tie
if $my_score==any(@other_scores) { say "I tied with ".score2name($my_score) }
#If my score is higher than anyone else's, I win!
if $my_score > any(@other_scores) { say "Oops, this doesn't DWIM!" }
Not a big deal in one way, but it's the kind of error that's easy to
overlook even when you're staring right at it. Which is why when I'm
writing SQL, I prefer to use SOME instead of ANY. If it were spelled
"some" in Perl, I figure all the extra typing would be worth it to
avoid an occasional error.
In any case, the Huffman coding is probably right because you want
to declare Any parameters more often than you want to talk about any
possible kind of Object, I suspect.
Are Objects really Everything? What about native types like int --
or (thanks to autoboxing) should I really be thinking of them as
Objects with built-in optimiser hints? Not that I have a good
example of why you'd want to specify a native-only type; I'm only
asking out of pedantic curiosity.
-David