Subject: Re: LISP and C++
From: Erik Naggum <erik@naggum.no>
Date: 1999/11/05
Newsgroups: comp.lang.lisp
Message-ID: <3150790975517777@naggum.no>

* markku.laukkanen@hybrid.fi
| What happens if some of the threads change the value-cell for
| symbol-function between the evaluation of function arguments.....

  nothing out of the ordinary.  accesses to the symbol-function slots are
  atomic, and the function object itself is obviously not changed in
  mid-flight.  (disasters might ensue if you change a shared library or an
  executable image on disk and it is paged in, but the Lisp world is not
  doing stuff like that, even though the Unix world seems to be quite fond
  of _not_ locking pages that are mapped into memory with the execute bit
  set.  sigh.)

| Don't remember any more if funcall 'foobar is legal, sigh has been
| programming for my bad luck with C/C++ for last 6 years.

  calls to global functions always go through the symbol-function slot of
  the symbol, anyway.  only if you capture the functional value of a symbol
  in a local binding (such as an argument to a function) will you avoid
  this lookup at every call.  (long-lived-thing #'function-that-may-change)
  is thus not a good idea if it makes lots of calls to that function, and
  it's better to make the call explicitly through the symbol, and that is
  indeed with (funcall <symbol> ...).

#:Erik