Re: Boolean bug ?

Scott Raney (raney@metacard.com)
Mon, 26 Feb 1996 16:21:06 -0700 (MST)

>
> Is this a possible bug ? This bug occurs in the gamma version of 2.0
> and in our embedded beta 3 version.
>
> Check out this simple function
>
> function booltest x
> return x="(" or x=")" or x="*" or x="-" or x="+"
> end booltest
>
> calling put booltest(".") actually returns TRUE.
> The function returns false for all characters - except for
> the characters in the boolean statements.
>
> If you remove the latter 2 booleans in the function then
> put booltest(".") returns FALSE.

This *is* a bug: it's treating "+", "-" and "." as numbers (+0, -0,
and .0) which is wrong (somebody got a little carried away with
optimizing, it seems).

The workaround, which in this case is actually better than the
original function, is to do something like:
return x is in "()*-+"

The workaround is better because only a single comparison needs to be
made, and there is no ambiguity about whether it's a string or number
comparison.

A few other things have cropped up in the 2.0 release, and so we plan
a "patch" release for the end of the week which will include a fix for
this problem.

Thanks for the report, but (as always) we appreciate your sending bug
reports to support@metacard.com.
Regards,
Scott

> cheers
>
> r.
>

-- 
***********************************************************************
* Scott Raney (raney@metacard.com)  Tcl and ksh: syntactic gymnastics *
* http://www.metacard.com           MetaCard: it does what you think  *
***********************************************************************