I hope you don't mind that I'll ask another question - what is the signature of sleep? The documentation says "sleep($deadline) Executes after $deadline". So here is what I would expect to work:
But from the example you gave above (and the other ones in the POD) it seems that actually sleep takes the $deadline from the context and the parameter passed to it is actually a callback - is that right or I am totally confused? What does it do with the passed callback?sub my_sleep(&) { ( $deadline ) = context; print "sleeping ", $deadline, "seconds\n"; &sleep($deadline); }
After having written that I read Re^5: IO::Lambda: call for participation - and it partially answers this and again I can see it described in the Predicates section. Somehow I did not notice it at the first reading - maybe I expected the predicates to be really simple mathematical logic predicates.
In reply to Re^7: IO::Lambda: call for participation
by zby
in thread IO::Lambda: call for participation
by dk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |