I appreciate you taking the time to incorporate changes.
in reply to IO::Lambda: call for participation
I'm still just not fundamentally getting it though. Why is everything nested in:
I mean, I don't get this continual nesting you have in all the examples. If you explained why this is nested as you introduce your first example, and that that's not a typo, and then explain the control flow (does "readable" get called first or last here??), I could get past this into the interesting details
print $socket "GET $url HTTP/1.0\r\n\r\n";
my $buf = '';
my $n = sysread( $socket, $buf, 1024, length($buf));
return "read error:$!" unless defined $n;
return $buf unless $n;
I'm not stupid. But I keep beating my head against that. And I think it's something fundamental to your approach, because I see it everywhere.
I think it might have something to do with this paragraph:
Whatever is returned by a condition callback (including the lambda condition itself), will be passed further on as @_ to the next callback, or to the outside, if the lambda is finished. The result of the finished lambda is available by peek method, that returns either all array of data available in the array context, or first item in the array otherwise. wait returns the same data as peek does
But I can't connect that abstraction to what it means to me as a programmer, or how that would result in all these nested definitions.
If you could enlighten me as to why you end up with "}}" in every example, that would help.