help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FW: this is United States calling (was: Re: [External] : Is there any di


From: Drew Adams
Subject: FW: this is United States calling (was: Re: [External] : Is there any difference between `equal' and `string=' for strings?)
Date: Sat, 21 Aug 2021 05:39:07 +0000

> I've heard of call by reference, call by value and call
> by copy.  How does that work in Elisp?
> And what if the value is a reference?

Lisp always passes a pointer to a value.  Not
a pointer as such - pointers are not things in
the language.

You don't think of manipulating pointers.
But what's passed is a reference to a value
(a memory location), and that value can be a
number, string, vector, symbol, cons, closure,
hash table,...

What happens corresponds exactly to what your
mental model already is, no doubt, when you
program in Lisp, however you might want to
characterize it.

The most important thing to be aware of is
that when a value is passed as an arg it's
_not copied_.  The value exists somewhere,
and its location is passed.  The function's
formal parameter is bound to (points to) the
existing value.

<<attachment: winmail.dat>>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]