On Thu, Dec 09, 2010 at 06:16:45AM -0600, David Nicol wrote: > On Wed, Dec 8, 2010 at 7:59 PM, Eric Wilhelm <[email protected]> wrote: > > > > If you can, avoid the need to document "I will pass a callback to your > > callback". > > > > --Eric > > Continuation-style programming requires that all the time.
Which is why CPS.pm documents them thus:
=head2 kforeach( \...@items, \&body, $k )
CPS version of perl's foreach loop. Calls the body code once for each element
in @items, until either the items are exhausted or the body invokes its $klast
continuation, then invoke $k.
$body->( $item, $knext, $klast )
$knext->()
$klast->()
$k->()
=cut
(see
http://search.cpan.org/~pevans/CPS-0.10/lib/CPS.pm#kforeach(_...@items,_\&body,_$k_)
--
Paul "LeoNerd" Evans
[email protected]
ICQ# 4135350 | Registered Linux# 179460
http://www.leonerd.org.uk/
signature.asc
Description: Digital signature
