I agree with Bert. If the "Argument expected ->" message would appear right after the colon, that would be of great help. Checking to see if there's a comment where there should be an argument might be trickier (maybe by that time the parser has already stripped the comments), but it would be a plus.<br>
It's hard to suggest something other than that; it's really not enough to just put the error message after the colon, because in the newbie's mind it will now be pointing to a string (s/he still hasn't been informed that it's a comment) so nothing has been clarified.<br>
If detecting the comment is too hard for the parser, maybe just say "expecting argument, found '.' ". That'll give me a clue and let me know it's skipping "hey" for some reason.<br><br>
<br><div class="gmail_quote">On Mon, Aug 8, 2011 at 6:33 AM, Bert Freudenberg <span dir="ltr"><<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On 08.08.2011, at 10:44, Frank Shearar wrote:<br>
<br>
> On 8 August 2011 03:42, P. <<a href="mailto:uploaded@gmail.com">uploaded@gmail.com</a>> wrote:<br>
>> Hi folks,<br>
>><br>
>> I'm sending this email to both Squeak-dev and Pharo-project as you can see.<br>
>> This is to suggest a fix.<br>
>><br>
>> I typed this on a workspace:<br>
>><br>
>> closure := [:x | Transcript show: x].<br>
>> closure value: "hey".<br>
>><br>
>> And when I "did it", the VM had me looking at this:<br>
>><br>
>> closure := [:x | Transcript show: x].<br>
>> closure value: "hey". Argument expected -><br>
>><br>
>> Which is cryptic at best for a newbie.<br>
>> I visited #<a href="mailto:squeak@irc.freenode.net">squeak@irc.freenode.net</a> and asked there.<br>
>> Ken Causey helped me out and even he missed the difference between "" and ''<br>
>> for a second.<br>
>> I believe it would be beneficial to newbies to have this enhanced somehow,<br>
>> to point<br>
>> out the fact that strings aren't double-quoted.<br>
><br>
> Tricky, given that the error message is correct. After you strip out<br>
> the comments, you have<br>
><br>
> closer value: .<br>
><br>
> which is clearly not kosher.<br>
><br>
> What kind of fix would work for you?<br>
<br>
</div>It would be nicer if the "Argument expected" was shown right after the colon. Possibly the compiler could say what it saw instead ("found comment instead of argument").<br>
<font color="#888888"><br>
- Bert -<br>
</font><div><div></div><div class="h5"><br>
> I'm just thinking that<br>
> special-casing when you have a process part of a keyword message send<br>
> followed by a comment is tricky:<br>
><br>
> this is: "valid" code<br>
><br>
> for instance.<br>
><br>
> frank<br>
><br>
>> Thanks,<br>
>><br>
>> Peter<br>
>><br>
>><br>
>><br>
>><br>
><br>
<br>
<br>
</div></div></blockquote></div><br>