Dr. Dobb's Python-URL! - weekly Python news and links (Mar 26)

Courageous jkraska at san.rr.com
Wed Mar 27 20:43:15 EST 2002


>I've just tried:
>
>suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT | NEWLINE 
>suite: simple_stmt | NEWLINE INDENT stmt* DEDENT          
>suite: simple_stmt | NEWLINE [INDENT stmt+ DEDENT]      
>
>None of which work. Mind you, I don't know the language of the 
>python parser-generator, having never seen it before, and so I am 
>just guessing things that looks like they might work. No doubt 
>someone more familiar with it could do better.

I'm not saying it's impossible, but I'm not surprised these
changes didn't work. I've recently clean-roomed a ANTLR parser
for Python and discovered a lot along the way. As it turns out,
some major conceptual pieces of Python are directly related to
the domain space of inferred-block-delimited programming languages.
What I'm trying to say here is that there are things about Python
that, if you had never seen Python but had implemented an
inferred-block-delimited language of your own, you'd say "oh,
of course."

Optional pass could be done. I'm sure. But with hair. So it's
not. And it's no big deal, really. There's so many other fish
to fry.

When something is an artifact of implementation versus problem-
domain constraints, I always consider this a wart, but then
there's warts and there are warts. "pass" isn't worth stuggling
over, in my mind.

I can think of other warts in other languages, much worse. Take
Java. They didn't do MI for implementation reasons. And as part
of the domain space, MI is a highly valuable problem solver.
I view Java's lack of MI as a very grave sin, the ultimate
admission of defeat by the implementer.

C//




More information about the Python-list mailing list