PLEAC project
Tom Bryan
tbryan at python.net
Thu Aug 16 11:39:05 EDT 2001
Alex Martelli wrote:
> I dispute this, given FAQ number 6 at
> http://pleac.sourceforge.net/pleac-faq.html
>
> It gives a Ruby example, but basically it boils down to: since
> Perl automatically initializes unbound variables, and "it is
> -very- important" that PLEAC snippets do just the same as the
> Perl Cookbook snippets, then it's not acceptable to use the
> various languages in the normal way -- presumably (not spelled
> out, but what else could it mean?) *every* variable being used,
> e.g. in Ruby or Python, needs a try/except (in Python's terms)
> to simulate Perl's "convenient" 'auto-initialization'.
That's now how I read that sentence. It seems to indicate that
he needs the program to function properly. That is, you can't
simply translate
$a = $b || $c
to Python's
a = b or c
That is, as in translating human language, capture the intent and
style of a solution. That is, don't solve a completely different problem,
and don't solve the problems in a completely different way, but don't do a
word for word translation.
Sounds worthwhile. For all of the Perl programmers, they can then compare
the Perl solution to the Python solution when they're stuck in a "I know
how to do this in Perl" situation, but they're trying to use Python.
---Tom
More information about the Python-list
mailing list