File: defstmrun.mac

package info (click to toggle)
maxima 5.10.0-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 44,268 kB
  • ctags: 17,987
  • sloc: lisp: 152,894; fortran: 14,667; perl: 14,204; tcl: 10,103; sh: 3,376; makefile: 2,202; ansic: 471; awk: 7
file content (34 lines) | stat: -rw-r--r-- 1,169 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
/*-*-Macsyma-*-*/
/*    (c) Copyright 1984 the Regents of the University of California.
          All Rights Reserved.
          This work was produced under the sponsorship of the
          U.S. Department of Energy.  The Government retains
          certain rights therein.                                     */

eval_when([translate,batch,demo],
	  load_package(sharem,"max$disk:[sharem]autolo"))$

herald_package(defstmrun)$

matchfix("{","}")$

reference_an_extend(x,accessor,expected_extend_type,slot_number):=
   block([type:extendp(x)],
      cond(type=false,not_an_extend(accessor,x),

	   type=expected_extend_type,extend_ref(x,slot_number),

	   true,
	   error("Attempt to use",accessor,"to access a slot of",X,
		 "Expected MACSYMA EXTEND type was:",expected_extend_type)))$

not_an_extend(alt,obj):=
   error(alt,"was not given a MACSYMA EXTEND object; argument was:",obj)$

alter_extend_check(x,alterant,expected_extend_type):=
   block([type:extendp(x)],
      cond(type=false,not_an_extend(alterant,x),

	   type#expected_extend_type,
	   error("Attempt to apply",alterant,"to alter",X,
		 "Expected MACSYMA EXTEND type was:",expected_extend_type)))$