[erlang-questions] comma-less lists and tuples

Ulf Wiger (TN/EAB) <>
Thu Sep 21 11:16:09 CEST 2006


 

Vlad Dumitrescu wrote:
> 
> On 9/21/06, Richard A. O'Keefe <> wrote:
> >>        What do you think? Am I missing something?
>
> Generality.
> 
> To put it another way, putting an Erlang syntax around sql
> statements (*) is just a way to make the programmer write
> extra code in order to make things easier for the compiler.
> Things should go the other way around, don't they?

Do you mean teaching the compiler to parse SQL, or to leave
it as is and letting the compiler remain ignorant? ;-)

One purpose of making things easier for the compiler is 
of course that the compiler can then _help you_ get it
right. This should then be a metric for evaluating any
special syntax: do we actually gain something by forcing
the programmer to write quasi-SQL rather than SQL directly?

(Despite the obvious problem with SQL that it is by no means
easy to parse - in part because it isn't case sensitive.)


> (*) especially if it's basically the same statement,
> but with added {} and commas and with some parts
> enclosed in single quotes

Enhanced readability is, I think, a secondary issue, but
also very important. But inventing a new syntax may then
confuse the reader unless it actually serves to make the
statement more intuitive.

BR,
Ulf W




More information about the erlang-questions mailing list