|Indenting vs begin/end email@example.com (1995-07-06)|
|Re: Indenting vs begin/end firstname.lastname@example.org (Ronald F. Guilmette) (1995-07-11)|
|Re: Indenting vs begin/end email@example.com (Jens Peter Secher) (1995-07-12)|
|Re: Indenting vs begin/end firstname.lastname@example.org (Charles Fiterman) (1995-07-17)|
|Re: Indenting vs begin/end email@example.com (1995-07-14)|
|From:||Charles Fiterman <firstname.lastname@example.org>|
|Date:||Mon, 17 Jul 1995 13:10:32 GMT|
M.M._van_der_Laan <email@example.com> 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.
Let me make a few suggestions.
1) The tab character is misplaced compression. It is also a good
editor command. It does not belong in programs. This simplifies
the question of what tab means in a program.
2) Count indentation from the leftmost character of the indented
material. Thus the meaning of indentation is visually obvious
and unambiguous. Further changes in the line over indented material
do not change things (this avoids the Hascall bug)
3) Indented material is a string until something declares otherwise.
if x < y
I love you
Comes out the lexer identical to
if x < y [print [hello world\nIlove you\n]\n]
The if casts the string to code or discards it if it can see it is unused.
if defined x
if defined x
Return to the
Search the comp.compilers archives again.