COMPARE() (was Re: browse keys (@bk))
Jay R. Ashworth
jra at baylink.com
Wed Jul 21 07:13:25 PDT 2004
On Wed, Jul 21, 2004 at 12:49:39AM -0400, Kenneth Brody wrote:
> Fairlight wrote:
> [...]
> > I probably tried an arithmetic function improperly in the past and assumed
> > it couldn't be done at all. I'm used to the old "it either evaluates to
> > true or it doesn't, and anything non-zero is true" results from many other
> > languages.
> [...]
>
> Well, one could argue that these other languages are deficient in that
> they don't have a boolean type, and so they must resort to defaulting
> to "not equals zero" for true/false. ;-)
>
> Of course, how would you handle non-numeric types? What does "if: @TD"
> mean?
IMSMHTUO, the suggestion at the root of this is "whenever a sane
definition for an automatic typecast exists, make it". The output of
COMPARE can be *interpreted* as a boolean: 0=true, non-0=false.
So why not let it be used that way if the user doesn't care which one's
higher, without making them type the extra characters? Yeah, I know,
filePro isn't perl. :-}
Cheers,
-- jra
--
Jay R. Ashworth jra at baylink.com
Designer Baylink RFC 2100
Ashworth & Associates The Things I Think '87 e24
St Petersburg FL USA http://baylink.pitas.com +1 727 647 1274
"You know: I'm a fan of photosynthesis as much as the next guy,
but if God merely wanted us to smell the flowers, he wouldn't
have invented a 3GHz microprocessor and a 3D graphics board."
-- Luke Girardi
More information about the Filepro-list
mailing list