In defence of the two-namespace rule
Cliff Crawford
cjc26 at nospam.cornell.edu
Thu Jan 27 18:28:59 EST 2000
Pada Mon, 24 Jan 2000 10:09:21 +0100, Dirk-Ulrich Heise bilang:
| >
| >My semantics prof always made us call currying "Schoenfinkelization",
| >because "Schoenfinkel came up with it first".
| >Do you know how hard it is to spell Schoenfinkelization? ;)
|
| [..]
| And does the word "closure" play an important role outside
| of the functional programming world?
I'm assuming you mean outside of programming in general, because I
mentioned semantics above. Well, traditionally semanticists who try
to represent the meaning of a sentence such as "John kicked the ball"
would say that "kicked" represents a two-place predicate (IOW, a
function that takes two arguments). So it would be written in
predicate logic as:
kicked(John, the ball)
However, there is evidence that "kicked the ball" forms a seperate
phrase or unit in the sentence (for example, you can say "John
kicked the ball, and Mary did too" where the word "did" is sort of
like a variable which references "kicked the ball"). So then you
might want to represent the sentence as:
kicked_the_ball(John)
or even:
(kicked(the ball))(John)
In that last one, "kicked" represents a curried (or
Schoenfinkelized :) function; it is a function which takes a noun
phrase X as its argument and which returns another function which
takes a noun phrase Y as its argument and returns true if Y
kicked X. I.e.:
kicked = lambda(X) (lambda(Y) (if Y kicked X: 1
else: 0))
This would mean that kicked(the ball) would represent a closure,
where the variable X is bound to the entity "the ball".
Semantics is a lot like programming, actually. :)
| (When you have curried a lot, this would probably mean in
| german: "Heute hab ich viel geschoenfinkelt." Try that!)
but-I-can't-even-say-it-<wink>-ly yr's, Cliff
--
cliff crawford -><- http://www.people.cornell.edu/pages/cjc26/
"All I need is a small town
with good Internet connectivity" - Nadine
More information about the Python-list
mailing list