why cannot assign to function call
Erik Max Francis
max at alcyone.com
Mon Jan 5 09:28:43 CET 2009
Derek Martin wrote:
> On Sun, Jan 04, 2009 at 09:30:20PM -0500, Steve Holden wrote:
>>> I'm going to go out on a limb and assert that there's NO POSSIBLE WAY
>>> a student could intuit Python's variable assignment behavior, having
>>> never been exposed to that same behavior prior. It needs to be
>>> taught.
>>>
>> As does assignment of any kind.
>
> I'm not sure that's true. Having taken algebra prior to learning Basic,
> I intuitively understood what this program would do when I executed
> it, the first time I saw the code, and before I read the explanation:
>
> 10 let x = 10
> 20 print x
Did you understand that the first time you saw the statement in BASIC:
X = X + 1
the = symbol couldn't possibly have the same meaning as it does in
algebra? In BASIC, this is a statement which replaces the value of a
variable X with the previous value, incremented by one. In algebra,
this is an equation which has no solutions, since it reduces to 0 = 1,
an equation which is inconsistent. The two things aren't even related.
That is the whole point here. Computer science and programming
languages have objects. Mathematics has no such concept whatsoever,
unless you wish to define one. You're welcome to do so with a rigorous
definition that you can publish papers about and decide whether other
mathematicians are interested in your line of reasoning, but pretending
that there is a natural overlap between the mathematical concepts of
equality and identity and the computer scientific ones (especially since
the term _identity_ isn't even used in remotely the same way) is simply
ignoring the fact that other people either won't know what you mean or
will presume you're misunderstanding something. Because, based on your
previous comments, you are.
--
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis
Do we ask what profit the little bird hopes for in singing?
-- Johannes Kepler, 1571-1630
More information about the Python-list
mailing list