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

Unforwarding cells



    Date: Fri, 28 Aug 87 14:33 PDT
    From: John Batali <Batali@SPAR-20.ARPA>

    What is the proper way to make a cell stop forwarding to another cell?
    
    I read from page 22 of volume 8:
    
	    To forward one arbitrary cell to another, given two locatives do
    
	    (sys:%p-store-tag-and-pointer locative1
		    sys:dtp-one-q-forward locative2)
    
    This works fine, but there is no indication anywhere of how to make
    locative1 not forward anymore.  The following works, and provides error
    checking if I try to read from the location without putting something
    else there:
    
	    (sys:%p-store-tag-and-pointer locative1 sys:dtp-null 0)
    
    Will this cause me grief later?  Is there an official way to do this?

That's basically a fine way to do it.  We should document it.

There is one bug in both of your calls to sys:%p-store-tag-and-pointer,
namely you didn't worry about the cdr code (in fact you clobber it to zero).
It would be much safer to preserve the cdr code, as follows:

  (sys:%p-store-cdr-type-and-pointer locative1 (sys:%p-cdr-code locative1)
				     sys:dtp-one-q-forward locative2)

  (sys:%p-store-cdr-type-and-pointer locative1 (sys:%p-cdr-code locative1)
				     sys:dtp-null 0)