Finding the instance reference of an object

greg greg at cosc.canterbury.ac.nz
Fri Oct 31 09:03:15 CET 2008


Douglas Alan wrote:
> greg <greg at cosc.canterbury.ac.nz> writes:

>>This holds for *all* languages that I know about, both
>>static and dynamic.
> 
> Then you don't know about all that many languages.  There are
> languages that use call-by-name, and those that use
> call-by-value-return.  Some use call-by-need and others do
> call-by-macro-expansion.  Etc.

I didn't mean that these are the only two parameter passing
mechanisms in existence -- I know there are others.

What I mean is that in all languages I know of that have
by-value or by-reference or both, they behave according to
the definitions I gave. If anyone has a counterexample,
I'll be interested to hear about it.

> For
> instance, most dialects of Lisp have procedural macros.  The calling
> semantics of procedural macros are quite different from the calling
> semantics of normal functions

Yes, but nobody refers to that as either by-value or
by-reference as far as I know. Lisp people would probably
talk about the parameter being passed either "evaluated"
or "unevaluated".

> If I tell you, for instance, that Java, Python, Ruby, JavaScript,
> Lisp, and CLU all use call-by-sharing, then I have said something that
> makes a similarity among these languages easier to state and easier to
> grasp.

If you told me they use "assignment by sharing", that would tell me
a lot *more* about the language than just talking about parameter
passing.

-- 
Greg



More information about the Python-list mailing list