Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
  • Where does the name "closure" come from?

I just realized this morning that I'd used the word 'closure' without explaining the two different meanings of that word.. my bad. Set closures and 'value capturing' closures are entirely different creatures, which trace their origins back to different mathematical definitions for the word 'closed'.

Regarding set closures, we say that a set S is closed for a certain operation '.' (where '.' is the traditional symbol for some unspecified operation) if 'a.b' is a member of S for every a and b in S. A set is open if a and b are in S, but 'a.b' isn't.

The set closure of S for 'a' under '.' is the smallest closed subset of S that contains a for operation '.': {'a', 'a.a', 'a.a.a', ...}

  • How is this related to a variable-binding-capturing "closure"

Different critter entirely.. while the set theory people were coming up with their definition of the word 'closed', the predicate calculus people were using it to mean something else.

Predicate calculus (aka: formal logic) revolves around statements called sentences. Each sentence indicates some relationship between basic entities, known as predicates. Without getting too technical, a predicate is a statement that has a truth value, and the sentence says something about the relationship between the truth values of its predicates.

Sentences can also contain variables, which work pretty much like function parameters. A sentence where every variable is bound to some predicate is called a closed sentence. A sentence with an undefined variable is called an open sentence.

A 'value capturing' closure binds an entity to one of a function's free variables, so in predicate calculus terms, it closes one variable in the function.. hence the term closure.


In reply to Re2: MOPT-04 - identification, part 2 by mstone
in thread MOPT-04 - identification, part 2 by mstone

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (12)
    As of 2014-09-17 19:46 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (98 votes), past polls