Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!ai.etl.army.mil!hoey From: hoey@ai.etl.army.mil (Dan Hoey) Newsgroups: comp.lang.lisp Subject: Re: multiple values and conditionals Message-ID: <293@ai.etl.army.mil> Date: 25 Apr 89 18:30:43 GMT References: <886@cadillac.CAD.MCC.COM> Reply-To: hoey@ai.etl.army.mil (Dan Hoey) Organization: USAETL, Fort Belvoir, Virginia Lines: 16 In article <886@cadillac.CAD.MCC.COM> vaughan@puma.cad.mcc.com (Paul Vaughan) writes of a multiple-value OR, specified to return all the values of the first form that returns a non-NIL first value. He motivates it with >(defun lookup (key primary-table secondary-table) > (declare (values value found found-key)) > (mv-or (gethash key primary-table) (gethash key secondary-table))) But in this case we probably want a MV-OR that returns the values of the first form to return a non-NIL *second* value. Furthermore, using a generalized MV-OR requires MULTIPLE-VALUE-LIST, which conses; for combining results of GETHASH we prefer MULTIPLE-VALUE-BIND or MULTIPLE-VALUE-SETQ, which generate no garbage but must be written with knowledge of the number of values to handle. Dan