On Nov 1, 2006, at 10:56 AM, Andy Davies wrote:
I'll wager at least a pint that under the hood:
varX = myFn(z)
passes a pointer to varX which is used by myFn to update the value
of varX
I'll take that wager. In a dynamic language such as Fox or Python,
varX could be a brand-new variable. Assignment statements are always
executed by evaluating the right side, and sticking the returned
result into the left side. If there are variables on the left side
that don't exist, they are created. Therefore, when the right side is
executed, there can be no pointer passed, since the memory location
(variable) hasn't yet been created.
<semantic>
so what's the difference?
</semantic>
It isn't just semantic. Passing variables by reference requires the
function to know that it's getting things passed that it can't touch
without potentially screwing something up, since any local
modifications aren't really local.
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.