Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wasatch!defun.utah.edu!sandra From: sandra%defun.utah.edu@wasatch.UUCP (Sandra J Loosemore) Newsgroups: comp.lang.lisp Subject: Re: declarations Message-ID: <1410@wasatch.UUCP> Date: 23 Mar 89 17:11:08 GMT References: <7325@phoenix.Princeton.EDU> Sender: news@wasatch.UUCP Reply-To: sandra%defun.utah.edu.UUCP@wasatch.UUCP (Sandra J Loosemore) Organization: PASS Research Group Lines: 27 In article <7325@phoenix.Princeton.EDU> eliot@phoenix.Princeton.EDU (Eliot Handelman) writes: >Question about IGNORE: > >(defun foo (x) > (declare (ignore x)) > :ignored) > >Should FOO complain about too many or too few >arguments, or can I count on this happening in all CL's? Steele doesn't >seem to have anything to say about it. The IGNORE declaration doesn't have anything to do with checking for the right number of arguments. See CltL page 61: "there must be exactly as many arguments as there are parameters". In other words, "it is an error" if there aren't. Sometimes an error is signalled, sometimes it's harmless, and sometimes Bad Things will happen. Some implementations use OPTIMIZE declarations to decide whether to check for this error in compiled code. If you really want FOO to take any number of arguments and ignore them all, try using: (defun foo (&rest x) (declare (ignore x)) :ignored) -Sandra Loosemore (sandra@cs.utah.edu)