Opinion on best practice...

Chris Angelico rosuav at gmail.com
Thu Feb 7 06:28:17 CET 2013


On Thu, Feb 7, 2013 at 10:46 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Dennis Lee Bieber wrote:
>> Though that is the nice feature of REXX*... Anything that wasn't
>> parsable as a REXX statement was automatically sent to the current
>> command processor.
>
> Nice? Are you being sarcastic? What you're describing sounds like a
> classic "Do What I Mean" system, which invariably end up being followed by
> anguished shouts of "Noooo, I didn't mean that!!!".
>
> If you say "Anything that isn't parsable is automatically sent to the
> shell", it doesn't sound too bad. But when you say "Unparseable junk is
> implicitly treated as code and sent off to be executed by something which
> traditionally tends to be forgiving of syntax errors and has the ability to
> turn your file system into so much garbage", it sounds a tad less
> appealing.

You misunderstand. It's actually a very simple rule. Python follows
C's principle of accepting that any return value from an expression
should be ignored if you don't do anything with it. REXX says that any
"bare expression" used as a statement is implicitly addressed to the
default host, which is usually a shell (though I built myself a MUD
system where the default would send text to the client, and shell
execution required ADDRESS CMD "some_command" explicitly); it's very
simple and doesn't feel like a DWIM system at all.

ChrisA



More information about the Python-list mailing list