From ... From: Erik Naggum Subject: Re: Keyword arguments Date: 1999/09/14 Message-ID: <3146303318559517@naggum.no>#1/1 X-Deja-AN: 524963036 References: mail-copies-to: never X-Complaints-To: usenet@news.eunet.no X-Trace: oslo-nntp.eunet.no 937314520 18295 193.71.66.49 (14 Sep 1999 13:08:40 GMT) Organization: Naggum Software; +47 8800 8879; +1 510 435 8604; http://www.naggum.no NNTP-Posting-Date: 14 Sep 1999 13:08:40 GMT Newsgroups: comp.lang.lisp * Mark Carroll | A simple wrapper like, | | (defmacro get-frame-name (frame &key kb) | `(if ,kb (gfp::get-frame-name ,frame :kb ,kb) | (gfp::get-frame-name ,frame))) hmmm. | (from the USER package) works fine. However, it stops working if I | change the first ,kb (after 'if') to t, giving "No methods applicable for | generic function" for some internal function that get-frame-name calls. a more precise reproduction of the error message would probably be a lot more revealing of the actual problem. | What I want to know is, seeing that the call to describe reveals no odd | default values for GFP:KB, why has the behaviour changed? Doesn't GFP:KB | get a value of nil in either case? I'm sure I'm not understanding | something fundamental, to be surprised by this. I'm not sure you should rely on such information as heavily as you do. here's an example that shows you the effect: CL-USER(85): (defun foo (&key (zot t))) FOO CL-USER(86): (arglist #'foo) (&KEY (ZOT T)) T CL-USER(87): (compile **) ; While compiling FOO: Warning: Variable ZOT is never used. FOO T NIL CL-USER(88): (arglist #'foo) (&KEY ZOT) T first of all, I don't understand theneed for your wrapper. if it does what you show us in that example, you could just import the symbol and get rid of the problem. but supposing there's any use for this wrapper in the first place, I'd do something very similar to this: (defmacro get-frame-name (&rest args) `(gfp::get-frame-name ,@args)) #:Erik