1 ;;;-----------------------------------------------------------------------------------
2 ;;; name : send-func.lisp
3 ;;; description: the compiler-macro 'sendable-function' stores a sendable
4 ;;; representation of a function (it's interpretable code).
5 ;;; notes : At the moment this works just in the empty environment.
6 ;;; It can't cope with closures or static variables.
7 ;;; contact : me (Michael Trowe)
8 ;;; copyright : You wanna copy this code? You fool!!!
11 ;;;-----------------------------------------------------------------------------------
13 (defvar *ncl-readtable
* ())
14 (define-compiler-macro sendable-function
(denom)
16 (let ((func (compile nil
',denom
)))
17 (store-denom ',denom func
)
20 (defmacro sendable-function
(denom)
23 (defun |
#>-reader|
(stream subchar arg
)
24 (declare (ignore subchar arg
))
25 (list 'sendable-function
(read stream t nil t
)))
27 (set-dispatch-macro-character #\
# #\
> #'|
#>-reader|
)
29 (setq *ncl-readtable
* *readtable
*)
31 (let ((denoms (make-hash-table)))
32 (defun store-denom (denom func
)
33 (setf (gethash func denoms
) denom
)
35 (defun get-denom (func)
36 (or (gethash func denoms
)
37 (f-denominator func
))))
39 (defun f-denominator (func)
40 (multiple-value-bind (expr x name
)
41 (function-lambda-expression func
)
43 (cond ((and name
(symbolp name
))