<div dir="ltr"><div><div><div><div><div>Though being reserved for return statements, the upArrow ^ could perfectly be accepted as a character composing a binary selector, like the verticalBar | already is.<br></div>Indeed there is no ambiguity, since the return ^ is always prefixed, while a binary message never is...<br>
(well, except in the method source, but method source must begin with selector, it cannot begin with a return statement, so no ambinguity there neither...).<br><br></div>I don't plan to use or add such selector in core Squeak/Pharo, but I think that it is important to allow a variety of selectors : it allows the most simple DSL : one using Smalltalk syntax (no need to define a new syntax, a new parser, etc...).<br>
</div><div>If we did it for |, I don't see why we shouldn't for ^.<br></div><div>Note that we recently also extended usage of - at any place in binary selectors (it was restricted to first position previously), though no core message is concerned so far.<br>
</div><div><br></div><div>The main objection could be that a missing period before a return statement won't be reported, but interpreted as a message send... like in:<br> x := a+b<br></div><div> ^x</div><div><br>
</div><div>But I don't think it's really a feature stopper.<br></div><div><br></div>It's very easy to modify the old Compiler and shouldn't be that hard in Opal too.<br></div>I'll try and push a prototype in Squeak inbox this evening.<br>
<br></div><div>What do you think?<br></div></div>