[erlang-questions] comma-less lists and tuples

Bob Ippolito bob@REDACTED
Wed Sep 20 19:05:30 CEST 2006


On 9/20/06, Rick Pettit <rpettit@REDACTED> wrote:
> On Wed, Sep 20, 2006 at 05:08:12PM +0200, Anton Berezin wrote:
> > On Wed, Sep 20, 2006 at 04:48:22PM +0200, Erik Reitsma (RY/ETM) wrote:
> > >
> > > > > When working with ErlSQL, I came to the opinion that in some cases,
> > > > > Erlang would benefit from allowing whitespace as a
> > > > delimiter in lists
> > > > > and tuples in place of commas. Consider this small example:
> > > >
> > > > would such a change create a problem when atoms look like this:
> > > > 'atom with space'?
> > >
> > > I don't see why if we can have 'atom,with,commas' already.
> >
> > While we are discussing commas, it would be extremely nice to allow a
> > trailing comma in lists and tuples:
> >
> >   [1,2,3,]
> >   {1,2,3,}
> >
> > This is very useful during development, it provides for less source editing
> > with no assumption that datastructures are cast in stone.
> >
> > Many languages support that already, including gcc variant of C.
> >
> > Pretty please?
>
> Are these really features worth debating at this time? Aren't there more
> important considerations regarding erlang than the ability to omit (or add
> extra) commas in lists?
>
> I don't mean to rain on the parade but this seems somewhat unimportant to me.
>

It certainly helps to have syntax features that make it easier to
write correct code. Allowing extra commas in lists and tuples would be
a small and easy win for usability.

However, adding a feature like this encourages people to write code
that isn't backwards compatible, so perhaps it's not worth doing.

-bob



More information about the erlang-questions mailing list