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

Re: OT - trivial programming language



Kai Grossjohann wrote:
> What happens when, after moving a block, it is surrounded by more or
> less levels of conditionals or loops?  I don't program Python, so I
> don't know.

[ snip ]

> I can paste some lines in the middle of this easily:

> if (...) {
>     a;
> d;
> e;
>     b;
> }

> Then I tell my editor to reindent the whole thing and Bob's my uncle.

> But if I do the analogous thing in Python, the d line ends the
> conditional...

    Actually it would look like this:
if foo:
    a
d
e
    b

    First off it looks damned wrong so you know something's wrong.  Where in
the above example it looks wrong but works.  It may, in fact, *be* weong.
Secondly I dunno about EMACS but in VIM, highligh the 2 middle lines, hit >>.
 Tada, indented just fine.

> But I'm sure that Python programmers don't have this kind of problem,
> so there must be something I'm not seeing.

    Of course, we're not expecting our editors to be smarter than we are.

-- 
         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
       PGP Key: 8B6E99C5       | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: