Proposal3: Make $_ a valid identifier character

Andrew P. Black black at cse.ogi.edu
Mon May 29 07:11:21 UTC 2000


At 16:32 +1200 2000.5.29, Richard A. O'Keefe wrote:
>Being able to read mail, web pages, &c with the ASCII printing characters
>looking like they should would be nice too.

Aye, it would indeed.

I'm not one for slavishly following standards when there is something 
better.  But without some basic standards, we would not even be able 
to communicate.  ASCII, ISO Latin-n and now Unicode are some of those 
basic standards.

Unfortunately, the ISO 8859 series of 8-bit standards does not 
include any of the four arrow glyphs.  There are a couple of 
positions in ISO 6429 (and thus in all of the ISO 8859 standards) 
that look interesting

0x91		PRIVATE USE ONE
0x92		PRIVATE USE TWO

These are in the middle of the C1 subset (which seems to be reserved 
for control characters), but if we are going to usurp a couple of 
positions for up arrow and left arrow, these may be good candidates. 
Is there an ISO expert on the list?

It's actually pretty amazing that all of those tty control characters 
are still part of ISO 8859.  I wonder what it would take to throw out 
all of them in favour of some useful mathematical symbols ...  I 
don't object to using the DOS CP 437 encodings, but hasn't history 
shown that someone objects?

As for $_ being a valid identifier character, I would not want to use 
_ in a Smalltalk identifier.  But I would like to be able to read 
text files that contain _ without it being erroneously turned into 
left arrow.  There is also a good precedent for using _ by itself as 
the name of a variable that is not otherwise used.  For example, if 
you have to supply a method with a one argument block, and you don't 
in fact care about the value of the argument, then you might want to 
call the argument _

	aCollection select: [ _ | first = true
					ifTrue:  [ first := false. true ]
					ifFalse: [ false ]
		    	    ]

Whatever code we select, It should be a simple matter to provide the 
paragraph editor with a (user settable) preference that lets me make 
some otherwise unused keystroke represent left arrow and up arrow. I 
might use option - and option |, but you might choose something 
different because  you have a different keyboard.

	Andrew





More information about the Squeak-dev mailing list