fixing undescores

Bert Freudenberg bert at impara.de
Tue Oct 18 10:39:00 UTC 2005


Am 18.10.2005 um 06:49 schrieb tim Rowledge:

>
> On 17-Oct-05, at 7:13 PM, Julian Fitzell wrote:
>
>
>> You know, last time this came up I swear it was a flamewar.  I  
>> think I may even have been against changing it.  But I can't for  
>> the life of me think why...
>>
>> I'm quite fond of the arrow glyph, and I don't particularly like  
>> typing := but the current system really is a little irritating.
>>
>
> The real problem is that all the other dimwits out there messed up  
> the fonts etc. Since we don't seem to have enough armoured  
> divisions to sort things out the traditional way I have a  
> suggestion that might interest someone enough to lead to some code.
>
> Instead of actually changing the assignment symbol to := and  
> requiring two keystrokes (with a release of shiftkey in the middle,  
> really annoying) how about
> adding a decent left-arrow to the fonts
> making the file-out-code methods convert our single char to a ':='  
> string
> making the file-in code change a ':=' to our single char
> making a suitable (mappable, please. I'd like to keep '_' as my  
> choice) keystroke translate to our char.
>
> If it really bothers people to convert arrow to' :=' and back,  
> maybe change the displayChars methods to convert on the fly? I  
> think perhaps, maybe, that might even allow us to have a private  
> arrow glyph and not have to mess with the font.
>
> Externally readable code will please most people. Internal code  
> will please me. Nobody  needs to suffer too much. Peace will reign,  
> at least in Squeakitania.

+1

I'm all for giving back the underscore glyph to $_. Patching all code  
is not that nice, if we can avoid it, we should.

So instead of overwriting the arrow glyph we should move it to some  
unused code point. In iso-8859-1 the code points 16r80 to 16r9F are  
reserved for control sequences, so we might pick one out of that  
range. Currently these glyphs are just empty (which we probably  
should correct, too - if there's interest I'll add that). To witness:

     (16r80 to: 16r9F) asByteArray asString

I just uploaded a new version of my fix underscores package that does  
that, it moves the arrow glyph to code point 16r9F. I also removed  
the evil overriding of methods in other packages. Get it here:

     http://source.impara.de/underscore.html

As for an easier-to-type key binding, Control-Q is unused, which you  
can hit easily with one hand. IIRC VisualWorks used Control-G, though.

I think I don't really like the file-in/out conversion, I'd rather  
have ':=' in the source always. For displaying that could be  
converted to the arrow on the fly.

- Bert -




More information about the Squeak-dev mailing list