🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Can I do multiple value returns in X-Lisp?

#251
From: Tony Olekshy
Date: Fri, 01 Feb 1991 01:00
24 lines
1329 bytes
I am trying to write a macro that sets the value of each symbol in a list
of symbols to the corresponding value from a list of values (presumably
returned by a function.  But when I try the following, the global foo and
bar are set, not those local to the let, which is what I want.  Reading
leads me to believe that this a property of set, so I have tried screwing
around with setq to no avail.  Does anyone have a lantern?

	(defmacro setset (names vals)
	    `(mapcar (lambda (n v) (set n v)) ,names ,vals))

	(defun baz () (list 234 436))

	(let (foo bar)
	    (setset '(foo bar) (baz))
	    (print (list foo bar))
	    )

	(print (list foo bar))

--
Yours etc., Tony Olekshy.       Internet: tony%oha@CS.UAlberta.CA
				  BITNET: tony%oha.uucp@UALTAMTS.BITNET
				    uucp: alberta!oha!tony
Where the spirit does not work with the hand there is no art. --Da Vinci
Technical Details
Message-ID: <470@oha.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!elroy.jpl.nasa.gov!usc!snorkelwacker.mit.edu!mit-eddie!uw-beaver!ubc-cs!alberta!oha!tony

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!elroy.jpl.nasa.gov!usc!snorkelwacker.mit.edu!mit-eddie!uw-beaver!ubc-cs!alberta!oha!tony
From: tony@oha.UUCP (Tony Olekshy)
Newsgroups: comp.lang.lisp.x
Subject: Can I do multiple value returns in X-Lisp?
Message-ID: <470@oha.UUCP>
Date: 1 Feb 91 01:00:50 GMT
Organization: Olekshy Hoover & Associates Ltd., Edmonton, Alberta, Canada.
Lines: 24