Jonathan Richards wrote:
> Interesting - I don't often see two (purportedly) equivalent pieces
> of code together like that. I put both examples into files: the
> python is 668 bytes, whereas the perl is 1074. Is python really
> that much more terse than perl, or is it an artefact of the
> translation? I have a mildly pathological attraction to terse
> languages;
It's an artifact. The translator takes python to perl, so by design
it's only going to use perl mechanisms that map 1:1 to python
equivalents. Idiomatic code like the following (initialize a hash
from Key=Value lines found on files in the command line) will never
appear from perlthon:
%hash = ();
while(<>) { chomp; next if ! /^([^=\s]+)\s*=\s*(.*)+/; $hash{$1} = $2; }
Hacks like this are always cool. But they're not a substitute for
picking the right tool for the job.
Andy
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel