analog of fundef for Maxima functions defined in lisp file
Subject: analog of fundef for Maxima functions defined in lisp file
From: Steve Haflich
Date: Sat, 18 Jun 2011 17:03:31 -0700
This discussion missing a few ards from the deck.
There is a _standard_ interface for obtaining the soure for a function
See cl:function-lambda-epression. However, there are no requirements on
this function. The ANS allows this function always to return nil, and
indeed, a lambda function defined in a non-empty lexical evironment
cannot be represented portably by its plain source sexpr.
cl-user(10): (defun foo (x) (1+ x))
foo
cl-user(11): (function-lambda-expression #'foo)
(lambda (x) (block foo (1+ x)))
nil
foo
but ...
cl-user(12): (block bar
(defun foo (x) (return-from bar
(1+ x))))
foo
cl-user(13): (function-lambda-expression #'foo)
(lambda (x) (block foo (return-from bar (1+ x))))
#<Augmentable interpreter environment 1>
foo
Some implementations record no sources. Others record interpreted
definitions, but not compilerd definitions loaded fro a binary file.