<br><br><div class="gmail_quote">On Fri, Mar 1, 2013 at 7:05 AM, Frank Shearar <span dir="ltr"><<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Ron,<br>
<br>
Oh dear. Here I was hoping it was just a Squeak bug, because that<br>
would be easy to fix. You can't define a method "foo : arg" after all;<br>
the : is part of the selector.<br></blockquote><div><br></div><div>But you can define foo:arg. The point is that the : is part of the selector, and whitespace after the colon and before the formal variable is allowed. So [:a:b:c| is analogous to a selector :::. It's more obvious if one writes _: a _: b _: c, etc. This syntax was thought about carefully.</div>
<div><br></div><div>BTW, you can also define a method that looks like</div><div><br></div><div>"comment" foo ^self</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I stumbled upon this because I noticed that Haskell's type identifiers<br>
- like "add :: Int -> Int -> Int" are very nearly valid Smalltalk.<br>
It's just the "::" that's not valid because we don't permit :s in<br>
binary selectors.<br>
<span class="HOEnZb"><font color="#888888"><br>
frank<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 1 March 2013 14:48, Ron Teitelbaum <<a href="mailto:ron@usmedrec.com">ron@usmedrec.com</a>> wrote:<br>
> Hi Frank,<br>
><br>
> I know this is true for a number of Smalltalk implementations. I found it<br>
> very surprising also. Someone I worked with always formatted their code<br>
> this way. He said it made it easier to double click and highlight the<br>
> variable. I wasn't sure that was enough reason to do it but he did.<br>
><br>
> Ron<br>
><br>
>> From: <a href="mailto:squeak-dev-bounces@lists.squeakfoundation.org">squeak-dev-bounces@lists.squeakfoundation.org</a> [mailto:<a href="mailto:squeak-dev-">squeak-dev-</a><br>
>> <a href="mailto:bounces@lists.squeakfoundation.org">bounces@lists.squeakfoundation.org</a>] On Behalf Of Frank Shearar<br>
>><br>
>> I was rather surprised to learn that the following is valid syntax:<br>
>><br>
>> [ : x | x + 1]<br>
>><br>
>> (Note the space before the argument name.)<br>
>><br>
>> In fact, this is too:<br>
>><br>
>> [ : "This is a really long comment in a very, very strange place.<br>
>> It makes it very hard to see that the : before this comment turns the<br>
> token after<br>
>> this comment into a block argument." x | x + 1]<br>
>><br>
>> Is that intentional? Does ANSI Smalltalk define it?<br>
>><br>
>> frank<br>
>><br>
><br>
><br>
><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>