Re: Is the dangling else a syntax bug?

wb@vestein.arb-phys.uni-dortmund.de (Wilhelm B. Kloke)
30 Jul 2001 01:09:57 -0400

          From comp.compilers

Related articles
[13 earlier articles]
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)
Re: Is the dangling else a syntax bug? wb@vestein.arb-phys.uni-dortmund.de (2001-07-30)
Re: Is the dangling else a syntax bug? mike@dimmick.demon.co.uk (Mike Dimmick) (2001-07-30)
Re: Is the dangling else a syntax bug? wclodius@aol.com (2001-07-30)
Re: Is the dangling else a syntax bug? joachim_d@gmx.de (Joachim Durchholz) (2001-07-30)
Re: Is the dangling else a syntax bug? marcov@toad.stack.nl (2001-08-02)
Re: Is the dangling else a syntax bug? vbdis@aol.com (2001-08-02)
Re: Is the dangling else a syntax bug? stephen_bevan@yahoo.com (2001-08-06)
| List of all articles for this month |

From: wb@vestein.arb-phys.uni-dortmund.de (Wilhelm B. Kloke)
Newsgroups: comp.compilers
Date: 30 Jul 2001 01:09:57 -0400
Organization: Unknown
References: 01-07-133 01-07-153
Keywords: syntax
Posted-Date: 30 Jul 2001 01:09:53 EDT

<vbdis@aol.com> wrote:
>"Joachim Durchholz" <joachim_d@gmx.de> schreibt:
>
>>An interesting variation of this is the use of unindentation as "end"
>>marker. This has been done e.g. in Python and Haskell.
>
>Did you ever see source code with a mix of tab and space characters?
>Such text becomes unreadable to both a human and a compiler, when the
>tab size is changed to some user defined value. The whole source code
>then is bound to a specific editor :-(


This argument doesn't count. Just don't use Tab, or forbid it like
other control characters in source files. Else. Your arguments against
tabbing works in any other context also. Using other spacing than
intended makes the stuff less readable.


>But perhaps I misunderstood your point. When the editor inserts the
>appropriate End keyword whenever a line is outdented, then everything
>is okay. But then it's a feature of the editor, not of the language.


Look into Haskell. It IS a feature of the language, as in Python.


>The use of EOL as a delimiter was discussed in a recent thread, and I
>think that it's not a practical solution. Then at least continuation
>lines must be introduced at the same time, to allow to break long
>lines into multiple shorter lines.
>
>Line breaks can cause problems, as I just had with Delphi and Unix
>source files. The compiler complained about too long lines, whereas
>the editor displayed the \n (without \r) as line ends. IMO we should
>leave the use of line breaks and indentation to the human user, and
>let the compiler ignore white space, control characters, and comments.


IMHO indentation without syntactic interpretation is just as error prone
as anything else. Indentation may wll be used to replace a lot of
brackets. Personally, I prefer Haskell style over List style. And
Algol68 style over Pascal style.
--
Dipl.-Math. Wilhelm Bernhard Kloke
Institut fuer Arbeitsphysiologie an der Universitaet Dortmund
Ardeystrasse 67, D-44139 Dortmund, Tel. 0231-1084-257


Post a followup to this message

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