Underscores in method names

Nevin Pratt nevin at smalltalkpro.com
Thu Oct 17 16:42:21 UTC 2002


Ian, this is great!  It greatly eases compatibility issues for moving 
code between dialects.

Is there any way to get it into the base image release?  What's the 
process for that?

Nevin



Ian Piumarta wrote:

>On Thu, 17 Oct 2002, Nevin Pratt wrote:
>  
>
>>Tim Rowledge wrote:
>>    
>>
>>>Nevin Pratt <nevin at smalltalkpro.com> is claimed by the authorities to have written:
>>>
>>>      
>>>
>>>>I was wondering if anybody knew what the rationale for disallowing 
>>>>underscores in method names for Squeak was.  For other dialects, this is 
>>>>allowed.
>>>>
>>>>        
>>>>
>>>Because the underscore is mapped to the assign arrow.
>>>      
>>>
>
>This is only a reason for not allowing them as the first character in a
>selector.  (The Scanner would have to be made context sensitive which
>AFAIK it currently isn't.)
>
>Ian
>  
>
>------------------------------------------------------------------------
>
>'From Squeak3.2 of 15 January 2002 [latest update: #4881] on 17 October 2002 at 2:30:42 pm'!
>"Change Set:		underscoreMadness
>Date:			17 October 2002
>Author:			Ian Piumarta
>
>Makes the Scanner accept underscores in words or keywords (but not in the first position since that would require context sensitivity).  Use of this changeset has been officially condemned by the Independent Board of Syntactical Aesthetics for Squeak."!
>
>
>!Scanner methodsFor: 'multi-character scans' stamp: 'ikp 10/17/2002 14:24'!
>xLetter
>	"Form a word or keyword."
>
>	| type |
>	buffer reset.
>	[(type _ typeTable at: hereChar asciiValue) == #xLetter or: [type == #xDigit or: [type == #leftArrow]]]
>		whileTrue:
>			["open code step for speed"
>			buffer nextPut: hereChar.
>			hereChar _ aheadChar.
>			source atEnd
>				ifTrue: [aheadChar _ 30 asCharacter "doit"]
>				ifFalse: [aheadChar _ source next]].
>	(type == #colon or: [type == #xColon and: [aheadChar ~= $=]])
>		ifTrue: 
>			[buffer nextPut: self step.
>			["Allow any number of embedded colons in literal symbols"
>			(typeTable at: hereChar asciiValue) == #xColon]
>				whileTrue: [buffer nextPut: self step].
>			tokenType _ #keyword]
>		ifFalse: 
>			[tokenType _ #word].
>	token _ buffer contents! !
>
>  
>






More information about the Squeak-dev mailing list