[BUG?] Missing class checks on send| and send& ?

Bijan Parsia bparsia at email.unc.edu
Mon Mar 19 19:05:52 UTC 2001


On Mon, 19 Mar 2001, Mike Rutenberg wrote:

> Bijan,
> 
> I think I understand your point finally.  You are saying that the
> comments in class Boolean for & and | directly says to "Evaluate the
> argument" in all cases, which does not match what the code actually
> does.

For various interpretations of "evaluate", yes.

> And that neither the code nor the comment match what the ANSI spec says.

Well, I'm not *as* confident of that. Remember ANSI specs (in general) are
written so as to be easy for existing stuff to conform to. The spec
defines the return value of the operators by the truth table, but it
*doesn't* define any errors. (I.e., it doesn't say "it is an error to pass
a non-boolean as an argument.) Which means, afaict, that the behavior is
undefined by the spec in that case. Which means, alas, that
implementations are free to do what they want: return an error, return the
argument (in false), return true, return false, return a random object
while maintain ANSI conformance.

What it means for you the application writer is that you shouldn't depend
on any of those implementation defined behaviors if you want to write a
portable program.

Thus, I think we could put in your checks and still be ANSI compliant, but
any code that depended on those checks wouldn't be ANSI portable.

The default behavior in the three implmentations I've thus far checked is
Squeak's, which is no surprise.

Cheers,
Bijan Parsia.





More information about the Squeak-dev mailing list