Yes, you're right, even though callback to grep is indeed a predicate in logical sense, the others are not. That's why I'm saying that IO::Lambda use of the word does not correlate with its use neither in logical/mathematical, nor in programming domains. Also, in IO::Lambda not callbacks, but functions accepting these callbacks are called predicates, which furthers the semantic distance between the word and its expected meaning even more. I wish there would be an established term describing such a functionality, but I don't know any. I was forced for devise a word for it, but as much as I dislike making up new words, and I know that it's sometimes acceptable to redefine an existing word, I chose "predicate", which I think gets closest to the definition of "function with perl signature (&), that accepts a callback on perl stack and parameters on the context stack, executes the callback when the event associated with function, and defined by parameter passed on context, is completed". The same concerns are valid for "lambda": there are no one-word terms for "lightweight FSM generator object tied with anonymous subroutine", except possibly "a monad", but people run away screaming from that word :)

In common use, if I'm not mistaken, I'm not a native speaker, predicates can be thought as constructs (words, sentences) answering questions "if?" and sometimes "when?", f.ex. "we'll talk when you come back", also assuming that we won't talk if you won't come back. In this sense, one can think of, say, predicate "read" in the same fashion: the callback will be called when a socket becomes readable, but it won't be called if the socket never becomes readable.

Nevertheless, I'm open to renaming "predicate" into something more appropriate.


In reply to Re^9: IO::Lambda: call for participation by dk
in thread IO::Lambda: call for participation by dk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.