2014-02-25 8:17 GMT+01:00 Frank Shearar <frank.shearar@gmail.com>:
On 24 February 2014 13:41, <commits@source.squeak.org> wrote:So
> Nicolas Cellier uploaded a new version of Compiler to project The Inbox:
> http://source.squeak.org/inbox/Compiler-nice.280.mcz
>
> ==================== Summary ====================
>
> Name: Compiler-nice.280
> Author: nice
> Time: 24 February 2014, 10:41:41.999 pm
> UUID: 6e62064c-bd88-4957-98e4-c57da15738fc
> Ancestors: Compiler-nice.279
>
> Accept ^ as a binary selector
> With this change, binary selector can be arbitrarily composed of #verticalBar | #upArrow ^ or any other Character classified as #binary (See Scanner class>>initializeTypeTable)
>
> =============== Diff against Compiler-nice.279 ===============
foo
| a |
a := 1 + 3
^ a.
actually means
foo
| a |
a := 1 + 3 ^ a.
^ self.
Which might be surprising - currently the former will fail with a
sensible error message. (I say this while liking that I can write "2 ^
2" instead of "2 squared"...)
Yep, this is the objection that I anticipated in my first annoucement.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...
If #'^' is not a Symbol, then you'll get a warning that you used a new selector.I don't remember, are all 1 char Symbol still interned, or did we change that?Of course, once you implement ^ as a binary message, then the code is accepted as is without any sort of warning...
It's the same for self which is interpreted as a message send in this code:x := 1 + self fooself bar: x.It warn once, at first self send, but then, #self is interned and you're never warned again...
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)Nicolasfrank