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

Bob Arning arning at charm.net
Sat Mar 17 18:05:46 UTC 2001


Hi Mike,

Hmmm... Have you been doing C in your spare time? ;-) It seems to me that you are suggesting one of two things:

- Compiler checking of argument types.

- That methods check the type of their arguments even when they don't actually use them.

Neither of these strikes me as in the spirit of Smalltalk or easy to do.

Cheers,
Bob

On Sat, 17 Mar 2001 10:45:48 +0100  mdr at scn.org (Mike Rutenberg) wrote:
>If I evalute the expression
>	true | 4
>I get back
>	true
>instead of the error I would expect to get complaining that 4 is not
>boolean.  The same happens for "true & 4".
>
>Is this intentional, or is it a missing check in the interpreter?
>
>This behaviour actually makes some incorrect code work that I would
>prefer to visibly fail, for example:
>	oldName = '.all.' | oldName = '.unclassified.' ifTrue: [^ self].

On Sat, 17 Mar 2001 18:41:48 +0100  mdr at scn.org (Mike Rutenberg) wrote:
>Ok, I admit.  It was too early in the morning for me to be trying to
>think about this.  What in the world was I talking about the interpreter
>for?  Oh well...
>
>It still feels a little unsafe to me that the parameters are not checked
>as booleans.  But I will look around to see if there any other errors,
>and then can always add more broad checking.





More information about the Squeak-dev mailing list