🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Possible bug: trouble with (mapcar '(lambda... )).

#235
From: Tony Olekshy
Date: Sun, 23 Dec 1990 03:47
32 lines
2094 bytes
Question for xlisp internals gurus follows below...

I just spent way too long debugging:

        (mapcar '(lambda (son) (send son :rpt-output menu$width))
	    (reverse menu$sons))

The problem is, of course, that the single quote should either be left off,
or replaced with #'.  I have taken the later course with all things that
should be functions, as is done in xlstat.

The reason this took so long to debug is that the quoted form was mostly
working (!), but on long enough data sets there would arise cases where other
instances of local variables named son were being garbage collected, and
cases where xlisp would simply core dump.  Since I've just been through the
experience of adding c functions to xlisp, I was uncertain as to whether or
not this was being caused by improperly protected temporary lvals in my code. 
Furthermore, I could only reproduce the problem with large data sets, and they
take time to run.  Oh well.

Now my question for xlisp internals gurus is: is there some trivial code that
would either: 1) promote a quoted lambda expression, as the first expression
to mapcar, to a function (since it works on short data sets, perhaps the code
to do such promotion is just missing the protection of the temporary lvals),
or 2) produce an error message when mapcar's first argument is not a valid
form?

--
Yours etc., Tony Olekshy.       Internet: tony%oha@CS.UAlberta.CA
				  BITNET: tony%oha.uucp@UALTAMTS.BITNET
				    uucp: alberta!oha!tony
Blowing is not playing the flute, you must make use of your fingers.--Goethe
Technical Details
Message-ID: <467@oha.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bu.edu!rpi!julius.cs.uiuc.edu!wuarchive!cs.utexas.edu!uunet!zephyr.ens.tek.com!uw-beaver!ubc-cs!alberta!oha!tony

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bu.edu!rpi!julius.cs.uiuc.edu!wuarchive!cs.utexas.edu!uunet!zephyr.ens.tek.com!uw-beaver!ubc-cs!alberta!oha!tony
From: tony@oha.UUCP (Tony Olekshy)
Newsgroups: comp.lang.lisp.x
Subject: Possible bug: trouble with (mapcar '(lambda... )).
Message-ID: <467@oha.UUCP>
Date: 23 Dec 90 03:47:37 GMT
Organization: Olekshy Hoover & Associates Ltd., Edmonton, Alberta, Canada.
Lines: 32