First parallel is that the sequence matters. As in normal, blocking code, you would expect programming a HTTP request asBut nothing clicked for me. Why are they nested? When does the closure passed to readable {} get executed? When does the code within the closure passed to writable get executed {}? And why?Here, the code is different:print $socket ... readline $socket;but the sequence is the same! To emphasize this fact, there's no additional indentation for inner closures, to highlight that the execution is top-down, one way, linear.writable { syswrite ... readable { sysread ... }}
This is the magic that is then fundamental to the rest of your description. Please explain it so we mere mortals can follow along. I can't understand anything further, because it seems to be based on something you think you are showing with this code.
In other words, you have writable, which takes a coderef. And readable, which takes a coderef. Somehow, the coderef passed to writable is built up by calling some other code and then the result of calling readable. Ooof. Too many layers. Head is hurting. What's the flow, and why?
And why are they nested!?!
In reply to Re^2: regarding 1.02 (was Re: IO::Lambda: call for participation)
by merlyn
in thread IO::Lambda: call for participation
by dk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |