Subject: Re: Pass by reference
From: Erik Naggum <erik@naggum.net>
Date: 2000/11/16
Newsgroups: comp.lang.lisp
Message-ID: <3183389778776917@naggum.net>

* Nils Goesche <nils.goesche@anylinx.de>
| I never understood what `call by name' means.

  It means that the full expression in the caller is evaluated in the
  callee, instead of actually passing in the object so evaluated.  For
  instance, if you pass in foo.bar[i], meaning the i'th slot in the bar
  vector of the foo object, the evaluation that leads to this object is
  performed in the callee with the prevailing values.  That is, if you
  also get passed in i by some means, you reference some other slot if
  you change the value of i, even though none of this is visible in the
  argument you actually reference.  The idea is that you should be able
  to modify the lexically named place in the caller from the callee as
  if you _were_ the caller.  Very clever implementation techniques are
  required to implement this insanity correctly and usefully, not to
  mention that code written with this feature used and abused east and
  west is exceptionally exciting to debug.

| Has it to do with Lisp's special variables?

  No relation at all.  (Various deities be thanked, etc.)

#:Erik
-- 
  ALGORITHM: a procedure for solving a mathematical problem in a finite
  number of steps that frequently involves repetition of an operation.
  ALGOREISM: a procedure for solving an electoral problem in a finite
  number of steps that frequently involves repetition of an operation.