🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.lisp.x
Article #106

xscheme bug

#106
From: Mikael Pettersson
Date: Wed, 30 May 1990 14:52
32 lines
1297 bytes
There's a bug in XScheme's <, <=, =, >= and > predicates.
Try the following:

	(= 10 20 30)

This should fail with a "bad continuation" message. The problem
is in the compare() function [xsmath.c]. It looks roughly as follows:

	compare(fcn)
        {
	    ...
	    for(icmp = TRUE; icmp && moreargs(); ..) {
		/* consume one more argument, compare it (using fcn)
		 * and set icmp to false if the comparison failed
		 */
	    }
	    return icmp ? true : NIL;
	}

As you can see, if the test fails before all arguments have been
consumed, the function will (try to) return, treating the remaining
arguments as the continuation...   The fix is simply to drop the
remaining arguments before returning:

	    drop(xlargc);
	    return icmp ...;


/Mike
-- 
Mikael Pettersson, Dept of Comp & Info Sci, University of Linkoping, Sweden
email: mpe@ida.liu.se or ...!{mcsun,munnari,uunet,unido,...}!sunic!liuida!mpe
Technical Details
Message-ID: <1894@majestix.ida.liu.se>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!snorkelwacker!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!liuida!mikpe

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!snorkelwacker!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!liuida!mikpe
From: mikpe@majestix.ida.liu.se (Mikael Pettersson)
Newsgroups: comp.lang.lisp.x
Subject: xscheme bug
Message-ID: <1894@majestix.ida.liu.se>
Date: 30 May 90 14:52:09 GMT
Organization: CIS Dept, Univ of Linkoping, Sweden
Lines: 32