<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 2013-09-11, at 23:14, Nicolas Cellier &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div><div><div><div><div><div><div><div>After verification, xColon is not so rare, it is invoked for every block argument...<br>But we can safely replace (token := self step asSymbol) with (token := String with: self step), no problem.<br>

</div><br>We can even change it to (token := self step) if we are willing to remove last scories of alternate selectors beginning with $:<br>
</div><div>Indeed, #: and #:x  are obsolete squeakism which would not compile in other dialects (#':' and #':x' is the universally correct syntax).<br></div></div></div></div></div></div></div></div></blockquote><div><br></div><div>Well, all Squeak-derived dialects still do support it. Pharo changed the printString of #: to #':', while Squeak and Cuis still print #:. And they all accept #:, #:x, and #:x:::.</div><div><br></div><blockquote type="cite"><div dir="ltr"><div><div><div><div><div><div><div>Removing this feature consists in</div>- removing #colon reference in xLitQuote scanLitWord scanLitVec scanAllTokenPosition <br>


- removing asSymbol send in xColon.<br></div></div></div></div></div></div></div></blockquote><div><br></div>+ changing printing for Symbol</div><div><br><blockquote type="cite"><div dir="ltr"><div><div><div><div><div><div>But that would imply that methods with #: or #:x literals would not compile anymore</div></div>And that #( :x ) would result in #( #':' #x ) instead of #( #':x' ).<br>

</div>After my last hacking this would be a safe change in trunk (at least Compiler recompileAll works) and I'm all for it, <br>... but who knows what could happen to exotic third-party code.<br></div><div>Having code load request resulting in a SyntaxError popping up is just one of the most annoying thing...<br>
</div><div>And having interpretation of a literal changing without any sort of indication is not much better!<br><br></div>#: would still be supported with (Scanner prefAllowUnicharSymbol: true) but not #:x<br></div></div></div></blockquote><div><br></div><div>What else would the pref allow? #: is the only thing I've seen "in the wild" (occurring in Etoys, OMeta, and DrGeo)</div><div><br></div><blockquote type="cite"><div dir="ltr"><div>Maybe we could make it a preference too for smoother migration?<br>
</div>Or some sort of disambiguating request if interactive and conservative behavior if not, like I did for 1@-2?</div></blockquote><div><br></div><div>That would seem like the user-friendliest option, better than a preference IMHO.&nbsp;</div><div><br></div><div>- Bert -</div><br><blockquote type="cite"><div dir="ltr"><div><div class="gmail_extra">Thoughts?<br></div><div class="gmail_extra"><br><div class="gmail_quote">2013/9/11 Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div>Ah right, thanks Bert.<br></div>I think that the send of xColon is rare anyway (assignment cases := apart, in which case we do not send asSymbol)<br>

<br></div><div>#':' is not referred directly in the Compiler stuff:<br>
</div>Let's see: (SystemNavigation default browseAllCallsOn: #':') -&gt; Oops yet another bug<br></div>See fix attached<br><br></div>Though I think asSymbol is necessary given implementation of scanLitWord, I'll look deeper later<br>


<div><br><br></div></div><div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/11 Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span><br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>Another sender used to be #xColon. Not sure if we need to worry about that one.</div>


<div><br></div><div>CharAsSymbolSenders sortedCounts</div><div>==&gt; {6474-&gt;#scanToken . 141-&gt;#xColon}</div><div><br></div><div>(this was from before your compiler changes)</div><span><font color="#888888">
<br><div><span style="border-collapse:separate;border-spacing:0px;font-size:12px"><div style="font-family:Helvetica">- Bert -</div><br></span></div></font></span><div><div><div>On 2013-09-06, at 01:58, Nicolas Cellier &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:</div>


<br><blockquote type="cite"><div dir="ltr">Thanks Bert, I just published a Compiler version that does not...<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/5 Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span><br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><br><div><div><div>On 2013-09-04, at 21:41, Nicolas Cellier &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:</div>



<br><blockquote type="cite"><div dir="ltr">A rapid review of senders indicates that Character asSymbol seems rather rare in a trunk image.<br><br>I found <br>#initTextConstants<br>#inOutdent:delta: (Character tab asSymbol asText which is rather crooked way of avoiding an allocation - String tab would allocate a new Object).</div>



</blockquote><div><br></div></div><div>Scanner&gt;&gt;scanToken appears to be the most often used sender, and may well be the original reason for caching the 1-char symbols.</div><div><br></div><div>It might be a good idea to time compilation of complex methods with and without OneCharacterSymbols. (my guess is it wouldn't make much of a difference these days)</div>



<span><font color="#888888"><div><br></div><div><span style="font-family:Helvetica;font-size:12px">- Bert -</span></div></font></span><div><div><span style="font-family:Helvetica;font-size:12px"><br>
</span></div><br><blockquote type="cite"><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/4 Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu" target="_blank">leves@elte.hu</a>&gt;</span><br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
There's another user of OneCharacterSymbols: Character &gt;&gt; #asSymbol. I don't know how often it's used (my guess is that it's rarely used), or how much slower it would be, if we were removing OneCharacterSymbols. The implementation would change from<br>





<br>
&nbsp; &nbsp; &nbsp; &nbsp; ^Symbol internCharacter: self<br>
<br>
to<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; ^Symbol intern: self asString<br>
<br>
Which means that an extra String will be created, and the lookup is done in the WeakSets, instead of an Array/WeakArray.<br>
<br>
<br>
Levente<br>
<br>
On Wed, 4 Sep 2013, Nicolas Cellier wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Well, as you were the last modifier, I prefer to have your advice :)<br>
<br>
Nicolas<br>
<br>
<br>
2013/9/4 Levente Uzonyi &lt;<a href="mailto:leves@elte.hu" target="_blank">leves@elte.hu</a>&gt;<br>
&nbsp; &nbsp; &nbsp; On Wed, 4 Sep 2013, <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> wrote:<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; A new version of Collections was added to project The Inbox:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://source.squeak.org/inbox/Collections-nice.530.mcz" target="_blank">http://source.squeak.org/<u></u>inbox/Collections-nice.530.mcz</a><br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ==================== Summary ====================<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Name: Collections-nice.530<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Author: nice<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Time: 4 September 2013, 2:21:28.852 am<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UUID: d732aa23-1c77-4c1e-abc0-<u></u>d8d4506b7f9f<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Ancestors: Collections-ul.529<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Fix this:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;self assert: (allSymbols select: [:s | s = '+']) size = 1.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1) It is un-necessary to enumerate the 1-char symbols, they already are in SymbolTable (the first time they were created via #findIntern: or by virtue of last #rehash) !<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2) We can use a WeekArray rather than an Array because there is no point in keeping a reference to unused 1-char symbols.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Maybe we should get rid of OneCharacterSymbols class var, but I didn't dare...<br>
<br>
<br>
I say we should nuke it. The only user is Symbol class &gt;&gt; #selectorsContaining:, but that method is pretty much broken:<br>
- it uses OneCharacterSymbols only for infix selectors<br>
- it can't find infix selectors longer than 2 characters<br>
- it tries to optimize some stuff, but wastes cycles on other stuff<br>
<br>
<br>
Levente<br>
<br>
<br>
&nbsp; &nbsp; &nbsp; =============== Diff against Collections-ul.529 ===============<br>
<br>
&nbsp; &nbsp; &nbsp; Item was changed:<br>
&nbsp; &nbsp; &nbsp; &nbsp;----- Method: Symbol class&gt;&gt;allSymbols (in category 'access') -----<br>
&nbsp; &nbsp; &nbsp; &nbsp;allSymbols<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "Answer all interned symbols"<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^Array streamContents:[:s|<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s nextPutAll: NewSymbols.<br>
&nbsp; &nbsp; &nbsp; - &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s nextPutAll: OneCharacterSymbols.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s nextPutAll: SymbolTable.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ].<br>
&nbsp; &nbsp; &nbsp; &nbsp;!<br>
<br>
&nbsp; &nbsp; &nbsp; Item was changed:<br>
&nbsp; &nbsp; &nbsp; &nbsp;----- Method: Symbol class&gt;&gt;initialize (in category 'class initialization') -----<br>
&nbsp; &nbsp; &nbsp; &nbsp;initialize<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "Symbol initialize"<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Symbol rehash.<br>
&nbsp; &nbsp; &nbsp; + &nbsp; &nbsp; &nbsp; OneCharacterSymbols := WeakArray new: 256.<br>
&nbsp; &nbsp; &nbsp; + &nbsp; &nbsp; &nbsp; (0 to: 255) do: [ :byte | byte asCharacter asSymbol].<br>
&nbsp; &nbsp; &nbsp; - &nbsp; &nbsp; &nbsp; OneCharacterSymbols := nil.<br>
&nbsp; &nbsp; &nbsp; - &nbsp; &nbsp; &nbsp; OneCharacterSymbols := (1 to: 256) collect: [ :i | (i - 1) asCharacter asSymbol].<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Smalltalk addToShutDownList: self.<br>
&nbsp; &nbsp; &nbsp; &nbsp;!<br>
<br>
&nbsp; &nbsp; &nbsp; Item was changed:<br>
&nbsp; &nbsp; &nbsp; &nbsp;----- Method: Symbol class&gt;&gt;internCharacter: (in category 'instance creation') -----<br>
&nbsp; &nbsp; &nbsp; &nbsp;internCharacter: aCharacter<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aCharacter asciiValue &gt; 256 ifTrue:[^self intern: aCharacter asString].<br>
&nbsp; &nbsp; &nbsp; + &nbsp; &nbsp; &nbsp; ^(OneCharacterSymbols at: aCharacter asciiValue + 1) ifNil: [OneCharacterSymbols at: aCharacter asciiValue + 1 put: (self intern: aCharacter asString)]<br>
&nbsp; &nbsp; &nbsp; - &nbsp; &nbsp; &nbsp; OneCharacterSymbols ifNil: [^self intern: aCharacter asString].<br>
&nbsp; &nbsp; &nbsp; - &nbsp; &nbsp; &nbsp; ^OneCharacterSymbols at: aCharacter asciiValue + 1<br>
&nbsp; &nbsp; &nbsp; &nbsp;!<br>
<br>
&nbsp; &nbsp; &nbsp; Item was changed:<br>
&nbsp; &nbsp; &nbsp; &nbsp;----- Method: Symbol class&gt;&gt;selectorsContaining: (in category 'access') -----<br>
&nbsp; &nbsp; &nbsp; &nbsp;selectorsContaining: aString<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "Answer a list of selectors that contain aString within them. Case-insensitive. &nbsp;Does return symbols that begin with a capital letter."<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | size selectorList ascii |<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; selectorList := OrderedCollection new.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (size := aString size) = 0 ifTrue: [^selectorList].<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aString size = 1 ifTrue:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ascii := aString first asciiValue.<br>
&nbsp; &nbsp; &nbsp; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ascii &lt; 128 ifTrue: [(OneCharacterSymbols at: ascii+1) ifNotNil: [:s | selectorList add: s]]<br>
&nbsp; &nbsp; &nbsp; - &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ascii &lt; 128 ifTrue: [selectorList add: (OneCharacterSymbols at: ascii+1)]<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ].<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (aString first isLetter or: [aString first isDigit]) ifFalse:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aString size = 2 ifTrue:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [Symbol hasInterned: aString ifTrue:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [:s | selectorList add: s]].<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^selectorList<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ].<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; selectorList := selectorList copyFrom: 2 to: selectorList size.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self allSymbolTablesDo: [:each |<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; each size &gt;= size ifTrue:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [(each findSubstring: aString in: each startingAt: 1<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; matchTable: CaseInsensitiveOrder) &gt; 0<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifTrue: [selectorList add: each]]].<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^selectorList reject: [:each | "reject non-selectors, but keep ones that begin with an uppercase"<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; each numArgs &lt; 0 and: [each asString withFirstCharacterDownshifted numArgs &lt; 0]].<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;"Symbol selectorsContaining: 'scon'"!<br>
<br>
<br>
<br>
<br>
<br>
<br>
</blockquote>
<br><br>
<br></blockquote></div><br></div>
<br></blockquote></div></div><div><span style="border-collapse:separate;border-spacing:0px;font-size:12px"><br></span>

</div>
<br></div><br><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div><br><br>
<br></blockquote></div><br></div>
</div></blockquote></div><br></div></div></div>
<br></blockquote></div><br></body></html>