<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">2014-02-25 8:17 GMT+01:00 Frank Shearar <span dir="ltr"><<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 24 February 2014 13:41, <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> wrote:<br>
> Nicolas Cellier uploaded a new version of Compiler to project The Inbox:<br>
> <a href="http://source.squeak.org/inbox/Compiler-nice.280.mcz" target="_blank">http://source.squeak.org/inbox/Compiler-nice.280.mcz</a><br>
><br>
> ==================== Summary ====================<br>
><br>
> Name: Compiler-nice.280<br>
> Author: nice<br>
> Time: 24 February 2014, 10:41:41.999 pm<br>
> UUID: 6e62064c-bd88-4957-98e4-c57da15738fc<br>
> Ancestors: Compiler-nice.279<br>
><br>
> Accept ^ as a binary selector<br>
> With this change, binary selector can be arbitrarily composed of #verticalBar | #upArrow ^ or any other Character classified as #binary (See Scanner class>>initializeTypeTable)<br>
><br>
> =============== Diff against Compiler-nice.279 ===============<br>
<br>
</div>So<br>
<br>
foo<br>
| a |<br>
a := 1 + 3<br>
^ a.<br>
<br>
actually means<br>
<br>
foo<br>
| a |<br>
a := 1 + 3 ^ a.<br>
^ self.<br>
<br>
Which might be surprising - currently the former will fail with a<br>
sensible error message. (I say this while liking that I can write "2 ^<br>
2" instead of "2 squared"...)<br>
<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>Yep, this is the objection that I anticipated in my first annoucement.<br></div><div>Note that the format is clearly expressing the intention, that makes me think that the Python's interpretation of formating is not that bad ;) but we ain't gonna change that...<br>
<br></div><div>If #'^' is not a Symbol, then you'll get a warning that you used a new selector.<br></div><div>I don't remember, are all 1 char Symbol still interned, or did we change that?<br></div><div>Of course, once you implement ^ as a binary message, then the code is accepted as is without any sort of warning...<br>
<br></div><div>It's the same for self which is interpreted as a message send in this code:<br></div><div> x := 1 + self foo<br></div><div> self bar: x.<br></div><div>It warn once, at first self send, but then, #self is interned and you're never warned again...<br>
<br></div><div>For this sort of error, we could have a kind of lint rule for checking indentation : a single tab after a cr should match a beginning of a new statement (same with proper indentation inside blocks)<br><br></div>
<div> Nicolas<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
frank<br>
<br>
</font></span></blockquote></div><br></div></div>