Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: IO::Lambda: call for participation

by zby (Vicar)
on Jan 02, 2009 at 08:42 UTC ( [id://733709]=note: print w/replies, xml ) Need Help??


in reply to IO::Lambda: call for participation

Interesting!

Out of curiosity - why the name?

Replies are listed 'Best First'.
Re^2: IO::Lambda: call for participation
by dk (Chaplain) on Jan 02, 2009 at 14:01 UTC
    As the others have answered, "lambda" being a reference to "callback", but not limited to that. It's also a reference to techniques from functional languages (currying, map/filter/folds) that also apply to the module.

    An example. lambda {} is a (lightweight) object capable of holding the state for you (like monads do), so the following (deliberatly simiplified) construct

    lambda { read { sysread(...) write { syswrite(...) }} }

    makes sure that a socket handle will only receive writing (and only writing) events after reading events were received.

    With this approach, other functional tricks can be done, f.ex. a map analog will make sure that all lambda objects (connections, states) execute sequentially:

    print mapcar( lambda { 1 + shift })-> wait(1..5); 23456
    where instead "1 + shift" there could be a full-fledged http connection, for example, or a DBI statement, or lock waiting procedure - all non-blocking, of course. So again, back to the question, it's mainly "lambda" because it shares some interesting hacks with functional programming.
Re^2: IO::Lambda: call for participation
by Bloodnok (Vicar) on Jan 02, 2009 at 11:58 UTC
Re^2: IO::Lambda: call for participation
by Jenda (Abbot) on Jan 02, 2009 at 13:03 UTC
      Yeah - actually I did make that mental link - I am just not sure how that applies to the library. But after reading the other post (mentioning callback) I must admit that yeah - it was quite obvious.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://733709]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-03-29 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found