References to symbols in functions?

From: Peter Seibel (peter_at_javamonkey.com)
Date: 06/30/04


Date: Wed, 30 Jun 2004 03:49:22 GMT

So I was thinking about how function calls work and how a function
such as foo:

  (defun foo () (bar))

when compiled needs to contain a reference to the symbol object BAR.
I.e. it can't just jump to the address of the BAR function because BAR
may get redefined. So my question is this: are the references to
symbols in a compiled function just another kind of object reference
when it comes to garbage collection? That is, if the garbage collector
moves the symbol object does the pointer to it from within the
function get dealt with in the same way. The more I think about it the
more it seems that would be the natural way to do it but who knows.
Also I imagine this might differ from implementation to implementation
so I'd be interested to hear about different implementation
techniques. Implementors?

-Peter

-- 
Peter Seibel                                      peter@javamonkey.com
         Lisp is the red pill. -- John Fraser, comp.lang.lisp


Relevant Pages

  • Re: References to symbols in functions?
    ... > when compiled needs to contain a reference to the symbol object BAR. ... > I.e. it can't just jump to the address of the BAR function because BAR ...
    (comp.lang.lisp)
  • Re: References to symbols in functions?
    ... >> when compiled needs to contain a reference to the symbol object BAR. ... >> I.e. it can't just jump to the address of the BAR function because BAR ...
    (comp.lang.lisp)
  • Re: get object name
    ... the name of the class is Bar. ... a reference to an instance of an object, ... A class is a blue-print. ... Just about any of the OO literature by the recognized authorities out ...
    (comp.lang.php)
  • Re: Lisp for the C21
    ... (defun foo (bar &optional baz) ... above can be statically checked by a compiler. ... Imagine a drawing function that calls two other drawing functions. ...
    (comp.lang.functional)
  • Re: Problems with view editor
    ... In the ViewComposer deleting a view resource from the composition arena using the "Edit\Delete" command from the menu bar removes the resource from its class. ... when dropping it on another view as a reference view. ...
    (comp.lang.smalltalk.dolphin)