[Chicago] Can you write Perl in Python?
Ian Bicking
ianb at colorstudy.com
Wed Dec 28 23:44:43 CET 2005
Martin Maney wrote:
> On Tue, Dec 27, 2005 at 11:46:10PM -0600, Edward S. Marshall wrote:
>
>>Bah, I'm obviously not a very good Perl programmer, then. 233 characters
>>is all I could make myself get it down to tonight, without my head
>>exploding, without resorting to map/lambda, and without representing the
>>template as a set of numbers. It's still pretty readable; maybe I'll
>>take a peek at it tomorrow.
>
>
> Came back to make sure I had an offering ready to go (the web site
> opens at 8:00 tomorrow morning). Found I'd forgotten one or two ugly
> little tweaks (some things make it just too hard to work on the code,
> so I was putting them off) and found a spare byte somewhere. 138
> bytes, one line. no maps or lambdas at all - had some once, list
> comprehensions saved bytes! I have an idea for a different way of
> encoding the table(s) that might be a little shorter overall. Or not.
> Maybe I'll try it tomorrow, or maybe I'll do something worthwhile
> instead.
List comprehension... I knew I was forgetting some entire language
feature somewhere. Of course, generator comprehension is just like list
comprehensions but without the [], so there might be some characters to
be saved there as well.
--
Ian Bicking / ianb at colorstudy.com / http://blog.ianbicking.org
More information about the Chicago
mailing list