[comp.lang.lisp.x] Two minor bug fixes for version 2.x

toma@tekgvs.LABS.TEK.COM (Tom Almy) (05/08/90)

Bug: APPEND does not signal an error if any of its arguments (except for the
last argument) is not a true list.


Repair: In xllist.c, xappend()

	while (xlargc > 1) {

	    /* append each element of this list to the result list */
	    for (list = nextarg(); consp(list); list = cdr(list)) {
		next = consa(car(list));
		if (val) rplacd(last,next);
		else val = next;
		last = next;
	    }
	    if (list != NIL) xlbadtype(*--xlargv);  /*ADDED LINE*/
	}


Bug: NCONC does not signal an error if any of its arguments (except for the
last argument) is not a list.


In xllist.c, xnconc()

	    /* ignore everything except lists */
/* Delete this comment ^^^^^^^^^^^^^^^^^^^^  */

	    if (((next = nextarg()) != NIL) && consp(next)) {
/* change				^    was 0 */
		/* concatenate this list to the result list */
		if (val) rplacd(last,next);
		else val = next;

		/* find the end of the list */
		while (consp(cdr(next)))
		    next = cdr(next);
		last = next;
	    }
	    else xlbadtype(*--xlargv);	/* ADDED LINE */
	}


Tom Almy
toma@tekgvs.labs.tek.com
Standard Disclaimers Apply