Re: Is the dangling else a syntax bug?

genew@shuswap.net (Gene Wirchenko)
17 Jul 2001 23:26:21 -0400

          From comp.compilers

Related articles
[6 earlier articles]
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)
Re: Is the dangling else a syntax bug? david.thompson1@worldnet.att.net (David Thompson) (2001-07-17)
Re: Is the dangling else a syntax bug? genew@shuswap.net (2001-07-17)
Re: Is the dangling else a syntax bug? genew@shuswap.net (2001-07-17)
Re: Is the dangling else a syntax bug? toon@moene.indiv.nluug.nl (Toon Moene) (2001-07-18)
Re: Is the dangling else a syntax bug? esmond.pitt@bigpond.com (Esmond Pitt) (2001-07-18)
Re: Is the dangling else a syntax bug? jcrens@earthlink.net (Jack Crenshaw) (2001-07-23)
Re: Is the dangling else a syntax bug? marcov@toad.stack.nl (2001-07-23)
Re: Is the dangling else a syntax bug? joachim_d@gmx.de (Joachim Durchholz) (2001-07-23)
Re: Is the dangling else a syntax bug? vbdis@aol.com (2001-07-27)
[7 later articles]
| List of all articles for this month |

From: genew@shuswap.net (Gene Wirchenko)
Newsgroups: comp.compilers
Date: 17 Jul 2001 23:26:21 -0400
Organization: Compilers Central
References: 01-06-073 01-07-020 01-07-029
Keywords: syntax, design
Posted-Date: 17 Jul 2001 23:26:21 EDT

lhp+news@toft-hp.dk (Lasse Hillerĝe Petersen) wrote:


>ralph@inputplus.demon.co.uk (Ralph Corderoy) wrote:
>
>>In favour of terminators are their similarity to the normal termination
>>of written English sentances. I don't leave the full stop off the last
>>sentance in this paragraph.
>
>On the other hand, most languages _do_ use the comma (and perhaps
>semicolon) as a separator. In any case, comparison with natural
>language is rather futile, as you rarely have nested periods.
>
>However, in natural languages, omitting a comma is rarely a cause for
>misunderstanding, whereas in programming languages it is almost always
>considered a syntactic error. Few languages make the semicolon
>optional (I don't consider line-oriented languages in that group); I
>believe Turing is one of them. Is there any evidence that using such a
>grammar is more error-prone, or is it just because it makes it harder
>to write a parser?
>
>-Lasse
>[I think I've seen stats that users get statement separators wrong more
>often than statement terminators, but I can't dig them up at the moment.
>-John]


          I've seen something to that effect, too. I don't remember where,
but perhaps some personal experience will help.


          Given something like
                    if cond
                          begin;
                          thingone;
                          thingtwo
                          end
and you want to add
                          thingthree
after
                          thingtwo
you have to edit two lines.


          It can also get very nasty:
                    thingone;
                    if condone
                          begin
                          thingtwo
                          end
                    thingthree;
In some languages, an end statement can have a comment. Here, the
thingthree call can be slurped up as the comment. NOT NICE!


          I much prefer having statement terminators. This is so much so
that I won't use a statement separator language if I can avoid it.


Sincerely,


Gene Wirchenko


Post a followup to this message

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