Microsoft Patents 'IsNot'

"Martin v. Löwis" martin at v.loewis.de
Sat Nov 20 17:38:56 EST 2004


Terry Reedy wrote:
> But, for whatever it is worth, the ref manual *does* label 'is not' as *an* 
> operator.  In this context, 'is not' is a compound (key)word with a space 
> (rather than a hyphen or neither).  Since English compounds can often be 
> written both with and without a space or hyphen, with the choice being a 
> matter of taste, the difference between 'IsNot' and 'Is Not' is rather 
> trivial

To a reader, but not in an implementation. I believe that Microsoft
would have allowed "foo is not Nothing" if they knew how to implement
it. In the compiler, input is split into tokens, and you can not only
have space between them, but sometimes also line breaks and comments.
It appears that the VB parser, when receiving the IsNot token,
immediately checks whether the thing it got before is an expression.
If this would have to take "is not" into account as well, it might
become more complicated.

> And 'is_not' is the CS alternate spelling of 'is not' with ' ' changed to 
> '_' (instead of '-') to indicate that the space is connective, forming a 
> compound word.

And I firmly believe that Microsoft has only "connected" spellings in 
mind, in this patent application. The option of unconnected spelling
(i.e. in multiple tokens) did not occur to them, or else they would
have given that in the examples.

> In names, Python also requires, for obvious lexical 
> reasons, connective spaces ('_'s).  Recognizing 'is not' as a unit requires 
> a special rule; 'is_not' might have been more consistent with the rest of 
> Python, but Guido was and is a keywords minimizer.  Without knowing this 
> rule, one could easily parse 'a is not b' as 'a is (not b)' like Basic 
> does.

See, in Python, there is *no* special rule for 'is' 'not'. It just falls
out naturally - the expression after 'is' just can't start with a 'not',
since only tests can start with 'not'; expressions are a special case of
test that can only start with '(', '+', '-', '~', '[', '{', '`', a name,
a number, or a string.

Regards,
Martin



More information about the Python-list mailing list