<br><br>On Tue, Aug 14, 2012 at 8:12 AM, Juan Vuletich (mail lists) &lt;<a href="mailto:juanlists@jvuletich.org" target="_blank">juanlists@jvuletich.org</a>&gt; wrote:<br>&gt; WRT #&#39;_value&#39; precedence, it answers 2 if allowUnderscoreSelectors is false.<br>

&gt; The question is actually meaningless in this case, as #&#39;_value&#39; is not a<br>&gt; valid selector... If you set the preference to true, it correctly answers 1.<br><br>The preference controls the behaviour of the scanner. That is, it controls whether &#39;a_b&#39; in scanned as 1 token or 3 tokens. It should have no effect on precedence. Consider the case where you set #allowUnderscoreSelectors to true, load a package that contains them, then set the preference to false again. That&#39;s probably the common case; cf ConfigurationOfXtreams. Now you&#39;ve got selectors containing underscores in the image, but the preference is set to false. Are those selectors invalid now? Is it meaningless to ask their precedence?<br>

<br>No, those messags continue to work fine, and reflective code may well encounter selectors with underscores in them. Consider the following code: <br><br>    <font face="&#39;courier new&#39;, monospace">Smalltalk allSentMessages select: [:ea | ea isSymbol and: [ea precedence = 2]]</font><br>

<div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">Cuis will include #&#39;_value&#39; in the answer. Or how about this:</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="&#39;courier new&#39;, monospace">    doesNotUnderstand: aMessage</font></div><div><font face="&#39;courier new&#39;, monospace">        aMessage selector precedence = 2 ifTrue:</font></div>

<div><font face="&#39;courier new&#39;, monospace">            [Transcript show: &#39;Got an infix message!&#39;]</font></div><div><font face="arial, helvetica, sans-serif"><br>
</font></div><div><font face="arial, helvetica, sans-serif">That kind of code may not be common, but it should work.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Thanks for pointing me to Cuis&#39; implementation. Digging into the details exposed a bug in my inelegant implementation as well—I had thought that binary selectors could contain underscores, but that&#39;s not the case. That implies that a single underscore is a unary message, not binary. Off to fix my test cases.</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Colin</font></div><div><font face="arial, helvetica, sans-serif"><br>

</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div>