[net.sources] YA XLISP Bug

jfw@mit-eddie.UUCP (John Woods) (09/24/84)

I botched the definition of the function "last", which in MACLISP, returns
the last CONS in a list, whereas in mine, returned the last element.
To get the MACLISP compatible "last", check out xllist.c, go to the function
last, and change the last line (which is return last.n_ptr->n_listvalue)
to just simply: return last.n_ptr;

Unless you like the wrong one better.
-- 
John Woods, Charles River Data Systems
decvax!frog!john, mit-eddie!jfw, JFW%mit-ccc@MIT-XX

Guns don't kill people, I kill people.

jfw@mit-eddie.UUCP (John Woods) (10/08/84)

> From ihnp4!stolaf!umn-cs!digi-g!mark@mit-eddie Sun Oct  7 18:07:08 1984
> Received: by mit-eddie.Mit-chaos.Arpa id AA08298; Sun, 7 Oct 84 17:58:07 edt
> From: ihnp4!stolaf!umn-cs!digi-g!mark@mit-eddie
> Received: by ihnp4.ATT.UUCP; id AA20879; 7 Oct 84 09:35:41 CDT (Sun)
> Date: Sun, 7 Oct 84 05:11:29 cdt
> To: umn-cs!stolaf!ihnp4!mit-eddie!jfw@mit-eddie
> Subject: Tonight's last XLISP Bug report
> Status: RO
> 
> 
> Yet another.  remprop befouls the property list if you a property that
> is not first in line.  This causes memory dumps on later gets.
> 
> The fix:
> 
> 
> +++++ xlext.c +++++
> 133,134c133,134
> < 		for (last = atom->n_plist,
> < 		     lptr = last->n_listnext->n_listnext;
> ---
> > 		for (last = atom->n_plist->n_listnext,
> > 		     lptr = last->n_listnext;
> 136,137c136,137
> < 		     last = lptr,
> < 		     lptr = lptr->n_listnext->n_listnext)
> ---
> > 		     last = lptr->n_listnext,
> > 		     lptr = last->n_listnext)
> +++++++++++++++++++++
> 
> 					-- Mark Mendel
> 					-- ...!ihnp4!umn-cs!digi-g!mark
-- 
John Woods, Charles River Data Systems
decvax!frog!john, mit-eddie!jfw, JFW%mit-ccc@MIT-XX

Guns don't kill people, I kill people.