4 ms·
M-. on a symbol brings you to the source code. Common Lisp also has built in the function FUNCTION-LAMBDA-EXPRESSION, which returns the source for a function -
by lispm 5y ago
M-. on a symbol brings you to the source code.
Common Lisp also has built in the function FUNCTION-LAMBDA-EXPRESSION, which returns the source for a function -> when Lisp has recorded its definition.
Try (DESCRIBE #'some-function) in SBCL to get information about the arglist, the types, the source file.
In a SLIME editor buffer try c-h m . This will display the buffer commands. There are a zillion of commands to get information about the symbols, code references, etc.
On my Lisp Machine:
Command: Show Source Code (a defined function spec) mts::init-facts
Source code for MTS::INIT-FACTS:
(defun init-facts ()
(setf *init-facts*
'((world (loc (actor joe) (val cave)))
(joe (loc (actor joe) (val cave)))
(world (loc (actor irving) (val oak-tree)))
(irving (loc (actor irving) (val oak-tree)))
(joe (loc (actor irving) (val oak-tree)))
(world (loc (actor water) (val river)))
(joe (loc (actor water) (val river)))
(world (loc (actor honey) (val elm-tree)))
(irving (loc (actor honey) (val elm-tree)))
(world (loc (actor worm) (val ground)))
(joe (loc (actor worm) (val ground)))
(irving (loc (actor joe) (val cave)))
(world (loc (actor fish) (val river)))
(irving (loc (actor fish) (val river))))))
Command: Show Callers (a symbol [default MTS::INIT-FACTS]) MTS::INIT-FACTS
MTS::MICRO-TALESPIN calls MTS::INIT-FACTS as a function.
MTS::MICRO-TALESPIN-DEMO calls MTS::INIT-FACTS as a function.
Done.
Command: