Windows installer: Update README.txt.
[maxima.git] / src / autol.lisp
blobc4719892143a0c0b899863dab05fc61c40409d67
1 (in-package :maxima)
3 ;; These are the helper functions for autoloading.
4 ;; The actual autoloading data is in src/max_ext.lisp
5 ;;(aload "plot.o")
7 (defun aload (file &aux *load-verbose* tem)
8 (let ((*read-base* 10.)
9 ($system (list '(mlist))))
10 (declare (special $system))
11 (setq tem ($file_search1 file '((mlist) $file_search_lisp $system)))
12 (and tem #-sbcl (load tem) #+sbcl (with-compilation-unit nil (load tem)))))
14 (defmfun $aload_mac (file)
15 (let ((tem ($file_search1 file '((mlist) $file_search_maxima))))
16 (when tem
17 (with-open-file (in-stream tem)
18 (batchload-stream in-stream :autoloading-p t)))))
20 ;;for defun,defmfun
21 (defun autof (fun file)
22 (unless (fboundp fun)
23 (setf (symbol-function fun)
24 #'(lambda (&rest l)
25 (aload file)
26 (apply fun l)))))
28 ;;for defmacro
29 (defun autom (fun file)
30 (unless (fboundp fun)
31 (setf (macro-function fun)
32 #'(lambda (&rest l)
33 (aload file)
34 (funcall (macro-function fun)
35 (cons fun l) nil)))))
36 ;;for defmspec
37 (defun auto-mspec (fun file )
38 (unless (get fun 'mfexpr*)
39 (setf (get fun 'mfexpr*)
40 #'(lambda (l)
41 (aload file)
42 (funcall (get fun 'mfexpr*) l)))))
44 ;;foo(x,y):=..
45 (defun auto-mexpr (fun file)
46 (unless (mget fun 'mexpr)
47 (mputprop fun
48 `((lambda) ((mlist) ((mlist) |_l|))
49 ((mprogn) ((aload) ((mquote) ,file)) (($apply) ((mquote) ,fun) |_l|)))
50 'mexpr)))
52 ;;foo(x,y):=..
53 (defmfun $auto_mexpr (fun file)
54 (unless (mget fun 'mexpr)
55 (mputprop fun
56 `((lambda) ((mlist) ((mlist) |_l|))
57 ((mprogn) (($aload_mac) ((mquote) ,file)) (($apply) ((mquote) ,fun) |_l|)))
58 'mexpr)))