A modest indentation proposal

Quinn Dunkan quinn at chunder.ugcs.caltech.edu
Fri Nov 30 15:07:25 EST 2001


On Fri, 30 Nov 2001 14:25:12 +0000, phil hunt <philh at comuno.freeserve.co.uk>
wrote:
>If I ever design a Python-like language, there will be 2 alternate syntaxes,
>one with and one without semantic indentation. So people will be able to
>write
>
>   if x > 3:
>      a := b + c
>      print a
>
>or:
>
>   if x > 3: {
>      a := b + c;
>      print a;
>   }
>   
>(Though why anyone would prefer the second way is beyond me).
>
>The language would be stored internally in a form resembling the upper
>of the two, and there would be automatic translators so everyone could
>see it the way they liked, with {} or not, with whatever number of 
>characters per indentation they liked, spaces/tabs, etc.

http://www.haskell.org/onlinereport/lexemes.html#lexemes-layout

I don't entirely like it because error messages can be confusing ("missing
close brace" when you mess up indentation) and code that uses both at once can
be confusing.  I'd rather have only indentation or only delimiters.  Having
both and a rule to magically transform from one to the other is too
complicated.



More information about the Python-list mailing list