Ticket #15: special-defun.lisp

File special-defun.lisp, 401 bytes (added by Mark Evenson, 15 years ago)

Example of DEFVAR shadowing &KEYWORD parmas in DEFUN

Line 
1(in-package :cl-user)
2
3(defvar bar nil)
4
5(defun foo (&key bar)
6  42)
7
8
9#|
10CL-USER> (foo :bar 2)
11
12Debugger invoked on condition of type PROGRAM-ERROR:
13  Unrecognized keyword argument :BAR
14
15...
16
17which is a little weird, because the lambda list for FOO looks ok:
18
19CL-USER>  (describe #'foo)
20#<FUNCTION FOO {5B663F}> is an object of type COMPILED-FUNCTION.
21The function's lambda list is:
22  (&KEY BAR)
23
24|#