home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 January / enter-2004-01.iso / files / maxima-5.9.0.exe / {app} / share / maxima / 5.9.0 / src / autol.lisp < prev    next >
Encoding:
Text File  |  2003-02-09  |  1.9 KB  |  78 lines

  1. (in-package "MAXIMA")
  2.  
  3. ;; These are the helper functions for autoloading.
  4. ;; The actual autoloading data is in src/max_ext.lisp
  5. ;(aload "plot.o")
  6.  
  7. (defun aload (file &aux *load-verbose* tem tried)
  8.   (let ((in file)
  9.     ($system  (list  '(mlist)
  10.              #+kcl (concatenate 'string si::*system-directory*
  11.                         "../src/foo.{o,lsp,lisp}"))))
  12.     (declare (special $system))
  13.     (setq tem ($file_search1 file '((mlist)
  14.                     $file_search_lisp
  15.                     $system)))
  16.     (and tem (load tem))))
  17.  
  18. (defun $aload_mac (file &aux *load-verbose* tem tried)
  19.   (let ((in file)
  20.     ($system  (list  '(mlist)
  21.              #+kcl (concatenate 'string si::*system-directory*
  22.                         "../{src,share,share1,sharem}/foo.{mc,mac}"))))
  23.     (declare (special $system))
  24.     (setq tem ($file_search1 file '((mlist)
  25.                     $FILE_SEARCH_MAXIMA
  26.                     $system)))
  27.     (and tem ($load tem))))
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. ;for defun,defmfun
  35. (defun autof (fun file)
  36.   (unless (fboundp fun)
  37.    (setf (symbol-function fun)
  38.            #'(lambda (&rest l)
  39.                   (aload file)
  40.               (apply fun l)))))
  41.  
  42. ;for defmacro
  43. (defun autom (fun file)
  44.     (unless (fboundp fun)
  45.       (setf (macro-function fun)
  46.           #'(lambda (&rest l)
  47.               (aload file)
  48.               (funcall (macro-function fun)
  49.                    (cons fun l) nil)))))
  50. ;for defmspec
  51. (defun auto-mspec (fun file )
  52.   (unless (get fun 'mfexpr*)
  53.   (setf (get fun 'mfexpr*)
  54.          #'(lambda (l)
  55.              (aload file)
  56.              (funcall (get fun 'mfexpr*) l)))))
  57.  
  58. ;foo(x,y):=..
  59. (defun auto-mexpr (fun file)
  60.     (unless (mget fun 'mexpr)
  61.           (mputprop fun
  62.               `((LAMBDA) ((MLIST) ((MLIST) |_l|))
  63.                    ((MPROGN) ((aload) ',file ) (($APPLY) ',fun |_l|)))
  64.           'mexpr)
  65.           ))
  66.  
  67. ;foo(x,y):=..
  68. (defun $auto_mexpr (fun file)
  69.     (unless (mget fun 'mexpr)
  70.           (mputprop fun
  71.               `((LAMBDA) ((MLIST) ((MLIST) |_l|))
  72.                    ((MPROGN) (($aload_mac) ',file ) (($APPLY) ',fun |_l|)))
  73.           'mexpr)
  74.           ))
  75.  
  76.  
  77.  
  78.