About correct binary method selector

Boris Gaertner Boris.Gaertner at gmx.net
Sun Nov 17 21:25:59 UTC 2002


----- Original Message -----
From: Stephane Ducasse <ducasse at iam.unibe.ch>
To: squeak dev dev <squeak-dev at lists.squeakfoundation.org>
Sent: Saturday, November 16, 2002 10:05 PM
Subject: About correct binary method selector

>>I would like to know the **exact rule** for creating binary selector.
>>Because | works but || or |< does not.

>>Where can I find this information?

The ANSII standard comes into mind.
In a draft from 1997 I found this:

<citation>
5.5.5 Operators
Three types of operator tokens are defined in Smalltalk: binary selectors,
the return operator, and the assignment operator.
.
binaryCharacter ::=
 '!' | '%' | '&'' | '*' | '+' | ','' | '/' | '<' | '=' | '>' | '?' | '@' |
'\' | '~' | '|' | '-'
binarySelector ::= binaryCharacter+

returnOperator ::= '^'

assignmentOperator ::=  ':='
Binary selectors are method selectors that appear similar to mathematical
operators. A binary selector may be any length greater than or equal to one.
If a negative <number literal> follows a binary selector there must
intervening white space.
An implementation may define additional binaryCharacters but their use may
result in a non-portable program.

</citation>

The selectors || and |< conform to the standard. Dolphin Version 2.1
(summer 99) accepts these selectors. Squeak is not fully ANSII-compatible
at this point. Ned mentioned, that the vertical bar is handled specially
in Squeak. I think this is in method  Parser>>pattern:inContext:
I think it would be a nice idea to examine whether we can make
Squeak more ANSII-conformant at this point.

Greetings, Boris










More information about the Squeak-dev mailing list