Chas. Owens wrote:
> On Thu, Apr 3, 2008 at 8:37 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
> snip
>>  > * Note, this is not real Huffman encoding, just Larry Wall's version of 
>> it.
>>
>>  Huffman encoding is a compression algorithm, used in GIF files if I
>>  remember correctly. It's not relevant to human-readable text. If you're
>>  anxious to make your programs as quick to type as possible then you
>>  should start by removing all whitespace.
> snip
> 
> Note the footnote.  Real Huffman encoding is a compression algorithm,
> but GIF uses LZW (the same basic algorithm behind gzip and a bunch of
> other lossless encryption schemes).  When you understand how Huffman
> encoding works you will understand the analogy being used.  Whitespace
> is very inexpensive in terms of keystrokes, if you are using a decent
> editor, and serves several very important functions.  The each in
> foreach serves little to no purpose and I, at least, tend to use a lot
> of for loops (iterator style, not the hated c-style).
> 
> from http://www.perl.com/pub/a/2007/12/06/soto-11.html?page=2 by Larry Wall
>     Each symbol has to justify its existence according to Huffman coding.

Thanks for the link Chas; it's fascinating - Larry is a remarkable man.

But he's pulling your leg. Most of what he writes (including the Camel)
is written tongue-in-cheek, and this is no exception.

In the same essay, he writes

> Some folks think Postmodernism means little more than the Empowerment
> of the Vulgar. Some folks think the same about Perl. ... Perl is a
> postmodern language.

Which isn't to be taken literally, although we know what he means.

The paragraph you're referring to says this

> Anyway, in Perl 6 we're raising the standard for where we use
> punctuation, and where we don't. We're getting rid of some of our
> punctuation that isn't really pulling its weight, such as parentheses
> around conditional expressions, and most of the punctuational
> variables. And we're making all the remaining punctuation work harder.
> Each symbol has to justify its existence according to Huffman coding.

He's saying it's a /bit/ like Huffman coding. It's also a bit like
organising your shopping so that you only do one trip a week. Or like
making the edges of your TV screen smaller so that most of what you see
is the picture.

I'm sure he didn't mean that typing the extra four characters in
'foreach' was a waste: if you don't have time for that you don't have
time for sleepng or eating. I would guess that 'for' or 'foreach' are
both a symbol in his analogy, and (especially since he's talking about
punctuation) he meant something like

  if $ok { print 'OK'; undef $ok; }

  for @list { print $_ if /match/; $count++; }

which aren't currently good syntax.

Cheers,

Rob

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to