<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.6082" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV> </DIV>
<DIV>"Gregory Ewing" <<A
href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</A>>
wrote in message <A
href="news:95ntriFod7U1@mid.individual.net">news:95ntriFod7U1@mid.individual.net</A>...</DIV>
<DIV>> Tim Roberts wrote:<BR>>> Andre Majorel <<A
href="mailto:cheney@halliburton.com">cheney@halliburton.com</A>>
wrote:<BR>>> <BR>>>>Anyway, it seems the Python way to declare a
function is<BR>>>><BR>>>> def f
():<BR>>>> pass<BR>>> <BR>>> No, that DEFINES a
function.<BR>> <BR>> Actually, it's more illuminating to say that it
*creates* a function.<BR>> <BR>> The 'def' statement in Python is an
executable statement. Executing<BR>> it has the effect of creating a function
object and binding it to<BR>> the indicated name. Before that has happened,
attempting to execute<BR>> any code referring to that name will fail.<BR>>
<BR>> Conversely, the function name doesn't need to be bound until
the<BR>> code referring to it is actually executed. So...<BR>>
<BR>>> def
g():<BR>>> return
f()<BR>>> def
f():<BR>>> return
3<BR>>> print g()<BR>> <BR>> works because
by the time g is *called*, both def statements<BR>> have been executed, and
both function names have therefore been<BR>> bound.<BR>> <BR>> --
<BR>> Greg<BR>> -- <BR>> <A
href="http://mail.python.org/mailman/listinfo/python-list">http://mail.python.org/mailman/listinfo/python-list</A><BR>>
<BR>></DIV>
<DIV> </DIV>
<DIV>Hello folks - I understand all of the above (well I suppose intuitively
based on the below) but had a longtime question and this is an opportunity to
ask. I have a B.A. in Linguistics and there was a topic they teach
'binding theory'. This was taught in the graduate classes or some that I
didn't take. I will bet that these things are related - binding theory and
this tossing around of words in software development like 'bound' and 'binding
them'. So I am wondering if you learned this in Computer Science or
Computer Engineering?, on the job? Is there a different theory in Computer
Science than I would find in linguistics?</DIV>
<DIV> </DIV>
<DIV>OK - so I just grabbed one of my semantics books and found one thing
in the index 'bound occurence of a reference in a formula', doesn't really
help. It is in the Predicate Logic section and just used while he is
trying to explain something else, used in context. </DIV>
<DIV> </DIV>
<DIV>Thanks</DIV>
<DIV> </DIV>
<DIV>Patty</DIV></FONT></DIV></BODY></HTML>