[squeak-dev] Authorize upArrow in binary symbols

tim Rowledge tim at rowledge.org
Wed Feb 26 22:19:47 UTC 2014


On 26-02-2014, at 2:02 PM, Tobias Pape <Das.Linux at gmx.de> wrote:

> 
> On 26.02.2014, at 21:39, tim Rowledge <tim at rowledge.org> wrote:
> 
>> 
>> I had a whole lot of stuff typed but really it boils down to something simple. We need at least one symbol within the common character set that we can use as a syntactic element not related to a typical character - a return token.
> 
> Don’t get me wrong, but how do you come to the conclusion “We need [paraphrased: a distinct] return token”?
> I mean, all other languages do without it, no?

C/Pascal/others use the return token ‘return’ spelled out. Those languages have a large complex syntax with ugly precedence rules so complex they need wall posters to list them all. In that context using a whole word seems a relatively minor crime. Smalltalk is simple. I like simple.


> I don’t want to say, we want to be like others,
> but apparently, we (Smalltalk family, w/ Self etc.) are lonesome single-charcter return token users, aren’t we?
> (Not that this would be wrong) So again, why do we need it explicitly?

Because that is how Smalltalk is. If we tried to use ‘return’, how would that read?

foo: aNumber
|temp|
temp := 4 + aNumber.
return temp
 - that looks both ugly and annoying to parse.

foo: aNumber
|temp|
temp := 4 + aNumber.
temp return
 - a little less ugly to read, and it even looks like a message send but implementation would be fairly nasty. Something like 
return
   thisContext sender returnValue: self

Yuck. How about we don’t break something that works nicely?



tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
An algorithm must be seen to be believed.




More information about the Squeak-dev mailing list