Keep It Simple, Stupid | |
PerlMonks |
Re: Re: Re: Re: Are strings lists of characters?by Chmrr (Vicar) |
on Oct 18, 2002 at 05:43 UTC ( [id://206224]=note: print w/replies, xml ) | Need Help?? |
I have not read Dominus' chapter, so I spent a minute pondering and came up with the following definition of imap, which is probably much less elegant than his: sub imap(&$) {defined($_=$_[1]->())?($_[0]->($_),&imap(@_)):()}Can you tell I've been writing too much Scheme recently? ;> I also was pondering other implementations of the example iterator discussed earlier, and thought that
..might be a hair faster than the reverse. Benchmark says it's not, though; oh, well. perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'
In Section
Meditations
|
|