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

Re: macptr question



At  4:42 PM 10/12/93 +0000, David Neves wrote:
>I want to have a macptr point to itself.  How can I do this?  If that
>is difficult I would settle for a macptr pointing to another macptr.
>
>If I understand %setf-macptr it doesn't do what I want as it sets a
>macptr to the contents of another macptr rather than its address.

If I understand your question correctly, you want something like:

(defun point-macptr-to-itself (macptr)
  (%setf-macptr macptr (%int-to-ptr (%address-of macptr))))

It is also possible that this is more what you want:

(eval-when (:compile-toplevel :execute)
  (require "LISPEQU"))

(defun point-macptr-to-itself (macptr)
  (%setf-macptr macptr
                (%int-to-ptr (+ ccl::$v_data (%address-of macptr)))))

Why you would want to do this escapes me. It isn't useful for much
of anything as the macptr will likely move as soon as the garbage collector
runs.