Re: Is the dangling else a syntax bug?

vbdis@aol.com (VBDis)
3 Jul 2001 23:26:26 -0400

          From comp.compilers

Related articles
Is the dangling else a syntax bug? vbdis@aol.com (2001-06-28)
Re: Is the dangling else a syntax bug? ralph@inputplus.demon.co.uk (2001-07-02)
Re: Is the dangling else a syntax bug? lhp+news@toft-hp.dk (2001-07-03)
Re: Is the dangling else a syntax bug? vbdis@aol.com (2001-07-03)
Re: Is the dangling else a syntax bug? ralph@inputplus.demon.co.uk (2001-07-06)
Re: Is the dangling else a syntax bug? ralph@inputplus.demon.co.uk (2001-07-06)
Re: Is the dangling else a syntax bug? gsc@zip.com.au (Sean Case) (2001-07-06)
Re: Is the dangling else a syntax bug? lars@bearnip.com (2001-07-06)
Re: Is the dangling else a syntax bug? vbdis@aol.com (2001-07-17)
Re: Is the dangling else a syntax bug? dynagen@eircom.net (Barry Kelly) (2001-07-17)
[16 later articles]
| List of all articles for this month |
From: vbdis@aol.com (VBDis)
Newsgroups: comp.compilers
Date: 3 Jul 2001 23:26:26 -0400
Organization: AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com
References: 01-07-020
Keywords: design, syntax
Posted-Date: 03 Jul 2001 23:26:26 EDT

ralph@inputplus.demon.co.uk (Ralph Corderoy) schreibt:


>Also, separators are a pain if appending a new item to the list means
>an easily forgotton separator needs to be added.


This can cause problems only in position dependent lists, like array
indices or subroutine arguments, where the list items reside near to
each other. Otherwise it should do no harm to add separators wherever
you like, the possibly resulting empty list entries can be ignored by
the parser/compiler.


Even in C you have statement (expression?) separators, which are distinct from
statement terminators, and allow to write down multiple statements as a
syntactically single statement: stmt1, stmt2, stmt3;
I sometimes used that option to bypass the otherwise required block delimiters
"{...}".


>>[It's a religious argument. Separators are more mathematically elegant,
but terminators match people's expectations better. -John]<<


I suspect that it's more than that, but I have no arguments due to my lack of
theory and practice in grammars :-(


DoDi
[The C comma operator separates expressions, not statements. -John]



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.