
4.6 Reference Pages
arglist function
arglist returns a list that describes the arguments to a function.
> (defun multiply (x y)
(* x y))
MULTIPLY
> (arglist 'multiply)
(X Y)
> (defun new-multiply (x y)
(declare (arglist factor1 factor2))
(* x y))
NEW-MULTIPLY
> (arglist 'new-multiply)
(FACTOR1 FACTOR2)
describe Function
describe object&optional output-stream
describe prints information about a specified object. The optional output-stream argument specifies which output stream the object should be read from. It defaults to the standard output. The functiondescribe returns no values.
*standard-output*.
> (describe 12) Twelve is a fixnum. Binary 1100, Octal 14, Decimal 12, Hex C, Roman XII> (describe '-) - is a symbol. Its home package is LISP. It is proclaimed special. Its global value is (DESCRIBE (QUOTE -)). Its global function definition is #<Compiled-Function - 166B17>. #<Compiled-Function - 166B17> is a compiled function. Its argument list is (NUMBER &REST MORE-NUMBERS). The code for this function is 276 bytes long. - has an inline definition known to the compiler.
> (describe (make-array 3)) #<Simple-Vector T 3 630DF3> is a simple vector. It has 3 elements.
> (describe *package*) #<Package "USER" 357B53> is the USER package. It uses the LISP and LIQUID-COMMON-LISP packages. It has no external symbols and no shadowed symbols.
inspect,describe-object (in The Common Lisp Object System)
grindef&rest function-name
grindef pretty-prints the source code associated with the name of an interpreted function. The macrogrindef returns no values.
> (defun grist (x y)
(let ((a 1) (b 2) (c 3))
(+ x a b c)))
GRIST
> (grindef grist)
(DEFUN GRIST
(X Y)
(LET ((A 1)
(B 2)
(C 3))
(+ X A B C)))
source-code Function
source-code function-or-method
source-code returns the source code of an interpreted function or method.
source-code returnsnil.
method generic-function-name {qualifiers}* ({specializer-name}*))
> (source-code #'car) NIL> (source-code #'(lambda (x) (1+ x))) (LAMBDA (X) (1+ X))
> (defun ink (x) (1+ x)) INK
> (source-code #'ink) (NAMED-LAMBDA INK (X) (BLOCK INK (1+ X)))
;;; Define the method ADD-ONE and create its associated ;;; generic function. > (defmethod add-one ((x number)) (+ x 1)) #<Standard-Method ADD-ONE (NUMBER)>
> (source-code '(method add-one (number))) (LAMBDA (X) (DECLARE (IGNORE X) (CLASS X NUMBER)) (BLOCK ADD-ONE (+ X 1)))
grindef

Generated with Harlequin WebMaker