1 ;;; -*- Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*- ;;;;
2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3 ;;; The data in this file contains enhancments. ;;;;;
5 ;;; Copyright (c) 1984,1987 by William Schelter,University of Texas ;;;;;
6 ;;; All rights reserved ;;;;;
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8 ;;; (c) Copyright 1982 Massachusetts Institute of Technology ;;;
9 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13 (macsyma-module numer
)
15 (load-macsyma-macros numerm
)
17 ;;; Interface of lisp numerical routines to macsyma.
18 ;;; 4:34pm Thursday, 28 May 1981 - George Carrette.
20 ;;; Trampolines for calling with numerical efficiency.
22 (defvar tramp$-alist
())
24 (defmacro deftramp$
(nargs)
25 (let ((tramp$
(symbolconc 'tramp nargs
'$
))
26 (tramp$-f
(symbolconc 'tramp nargs
'$-f
))
27 (tramp$-m
(symbolconc 'tramp nargs
'$-m
))
28 (l (make-list nargs
)))
29 (let ((arg-list (mapcar #'(lambda (ign)ign
(gensym)) l
)))
31 (push '(,nargs
,tramp$
,tramp$-f
,tramp$-m
) tramp$-alist
)
32 (defmvar ,tramp$
"Contains the object to jump to if needed")
33 (defun ,tramp$-f
,arg-list
34 (float (funcall ,tramp$
,@arg-list
)))
35 (defun ,tramp$-m
,arg-list
36 (float (mapply1 ,tramp$
(list ,@arg-list
) ',tramp$ nil
)))))))
42 (defmfun make-tramp$
(f n
)
43 (let ((l (assoc n tramp$-alist
:test
#'equal
)))
45 (merror "Bug: No trampoline of argument length ~M" n
))
47 (let (tramp$ tramp$-m tramp$-f
)
48 (declare (special tramp$ tramp$-m tramp$-f
))
52 (let ((whatnot (funtypep f
)))
55 (setf (symbol-value tramp$
) f
)
58 (setf (symbol-value tramp$
) (cadr whatnot
))
61 (setf (symbol-value tramp$
) (cadr whatnot
))
64 (merror "Undefined or inscrutable function~%~M" f
)))))))
69 (and (symbolp x
) (fboundp x
) (symbol-function x
))
70 (maxima-error "No subr property for ~a!" x
)))
74 (let ((mprops (mgetl f
'(mexpr)))
75 (lprops (and (fboundp f
)
76 (list 'expr
(symbol-function f
)))))
80 (getl f
'(operators)))))
84 (list (if (member (car f
) '(function lambda named-lambda
) :test
#'eq
)