File: diffop.mc

package info (click to toggle)
maxima 5.6-17
  • links: PTS
  • area: main
  • in suites: woody
  • size: 30,572 kB
  • ctags: 47,715
  • sloc: ansic: 154,079; lisp: 147,553; asm: 45,843; tcl: 16,744; sh: 11,057; makefile: 7,198; perl: 1,842; sed: 334; fortran: 24; awk: 5
file content (48 lines) | stat: -rw-r--r-- 1,084 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
;;; -*- Lisp -*-
;;; DIFFOP: A Library for making ' a more useful character in Macsyma
;;;
;;; Loading this file sets things up so that you can do
;;;
;;;	DEPENDS(F,X); => [F(X)]
;;;
;;;	F';	      => dF/dX
;;;
;;;                        3
;;;	F'3; or F'''; =>  d F
;;;			 -----
;;;			    3
;;;			  dX
;;;
;;;  If a variable has more than one DEPENDS property, the variable
;;;   which will be used is undefined.
;;;  If a variable has no DEPENDS property, UND will be used as the
;;;   variable to differentiate by.

(DECLARE (*EXPR $LISTOFVARS MGET))

(DEFUN INFER-DEPENDENCY (X)
  (OR (CAR (MGET (CADR ($LISTOFVARS X)) 'DEPENDS)) '$UND))

(DECLARE (SPECIAL STRING)) 

 ;Makes awfully big assumptions about the internals of GRAM

(DEFUN PARSE-PRIME (OP LEFT) 
  (SETQ LEFT (CDR LEFT))
  (CONS '$ANY 
	(LIST '($DIFF)
	      LEFT
	      (INFER-DEPENDENCY LEFT)
	      (+ -1
		 (FLATC OP)
		 (COND ((AND STRING (NUMBERP (CAR STRING)))
			(POP STRING))
		       (T 0))))))

(DEFPROP $/' 195. LBP)

(DEFPROP $/' PARSE-PRIME LED)

(DEFPROP $/'/' 195. LBP)

(DEFPROP $/'/' PARSE-PRIME LED)