[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT - trivial programming language



Steve Lamb <grey@dmiyu.org> writes:

> Faheem Mitha wrote:
>> Bob Proulx makes good points elsewhere in this thread. Whether you
>> like the indentation as syntax feature is really a matter of
>> taste. Personally, I am ambivalent about it. On the one hand it makes
>> code more compact. On the other hand, indentation is easily lost
>> information, for example when cutting and pasting. Also, I have the
>> habit in emacs of hitting tab to get code to line up. I've done this
>> for years, and it is a hard habit to break. Unfortunately it has
>> disastrous consequences in python code.
>
>     So have EMACS treat the tab key as the equivolent number of spaces and
> write the file out using spaces instead of tabs.

This won't help: in Emacs, TAB computes the right indentation from
the buffer contents.  In C-like languages, this is fairly easy: after
a "{", indent more, after a "}", indent less.  There are a lot of
other rules, but that's the basic.

But in Python, it is not possible to compute the indentation from the
buffer contents.  This means that just hitting TAB on each line is
either a no-op (then why are we doing this), or it would get the end
of a loop wrong and suchlike.

Kai




Reply to: