Re: Indenting vs begin/end

"Ronald F. Guilmette" <>
Tue, 11 Jul 1995 07:09:18 GMT

          From comp.compilers

Related articles
Indenting vs begin/end (1995-07-06)
Re: Indenting vs begin/end (Ronald F. Guilmette) (1995-07-11)
Re: Indenting vs begin/end (Jens Peter Secher) (1995-07-12)
Re: Indenting vs begin/end (Charles Fiterman) (1995-07-17)
Re: Indenting vs begin/end (1995-07-14)
| List of all articles for this month |

Newsgroups: comp.compilers
From: "Ronald F. Guilmette" <>
Keywords: design, syntax
Organization: a2i network
References: 95-07-062
Date: Tue, 11 Jul 1995 07:09:18 GMT

M.M._van_der_Laan <> wrote:
>I am designing a language where end-of-line means end-of-statement
>and where indenting is used instead of begin-end. While this saves
>a lot of typing and prevents the programmer from errors, there are
>a lot of people against it (see 'the semicolon habit' and other
>articles). I can think of two extensions to the language to
>overcome their problems:
>- Add a TAB <n> compiler directive to adjust the tab width. This
> allows people to use different settings. Also, when code tends
> to walk off the right side of your screen you could adjust the
> tab setting temporarily to a smaller amount.
> It might also be nice to have your texteditor recognize this
> directive and adjust its own setting accordingly.
>- Add some directive to switch to begin/end statements instead of
> indenting. End of line will still be end-of-statement, however.
> This might also be easier for program generators to generate code.
>Would this satisfy everyone's needs?
>I found one problem myself: placement of labels on empty lines.
>In this code:
> while a < b
> a = a+1
> next statement
>there is no way for the compiler to tell if the label points to the end of
>the loop or to the statement after the loop. Can anyone think of a solution?

The first language I ever implemented was like the one you describe... It
was a ``structured'' language, all based upon indentation and line-ends.

I never had the problem you describe with regard to labels. Why? Simple.
In the language in question, there were no labels. There also were no
`goto' statements.


-- Ron Guilmette, Sunnyvale, CA ---------- RG Consulting -------------------
---- E-mail: ----------- Purveyors of Compiler Test ----
---- finger: ----------------- Suites and Bullet-Proof Shoes -


Post a followup to this message

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