trailing commas

View: New views
2 Messages — Rating Filter:   Alert me  

trailing commas

by Nick Guenther :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In other languages it is surprisingly useful to be able to leave
commas hanging (e.g. in a list that may expand). Currently, Io says
  Exception: compile error: "missing argument in argument list" on
line 12 character 233
  ---------
  message 'Error' in '[unlabeled]' on line 0


if I give it
descriptions := list("a",
        "b",
        )
which is just confusing. It would be really helpful if trailing commas
were allowed.

-Nick

Re: trailing commas

by Ward Cunningham :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have to agree.

At first I thought trailing separators left a program looking  
unfinished. Now I've become use to them and must say, thank you  
compiler writer for letting me get on about my business.

I am reminded of the Java spec that did not allow for trailing  
whitespace after the final 'end'. Compiler writers deviated from the  
spec, otherwise the final newline would blow the compile.

__________________
Ward Cunningham
503-432-5682





On Jun 11, 2008, at 11:02 PM, Nick Guenther wrote:

> In other languages it is surprisingly useful to be able to leave
> commas hanging (e.g. in a list that may expand). Currently, Io says
> Exception: compile error: "missing argument in argument list" on
> line 12 character 233
> ---------
> message 'Error' in '[unlabeled]' on line 0
>
> if I give it
> descriptions := list("a",
> "b",
> )
> which is just confusing. It would be really helpful if trailing commas
> were allowed.
>
> -Nick
>
>

LightInTheBox - Buy quality products at wholesale price