2 /* (c) Copyright 1984 the Regents of the University of California.
4 This work was produced under the sponsorship of the
5 U.S. Department of Energy. The Government retains
6 certain rights therein. */
8 eval_when([translate,batch,demo],
9 load_package(sharem,"autolo"))$
11 herald_package(defstmrun)$
15 reference_an_extend(x,accessor,expected_extend_type,slot_number):=
16 block([type:extendp(x)],
17 cond(type=false,not_an_extend(accessor,x),
19 type=expected_extend_type,extend_ref(x,slot_number),
22 error("Attempt to use",accessor,"to access a slot of",X,
23 "Expected MACSYMA EXTEND type was:",expected_extend_type)))$
25 not_an_extend(alt,obj):=
26 error(alt,"was not given a MACSYMA EXTEND object; argument was:",obj)$
28 alter_extend_check(x,alterant,expected_extend_type):=
29 block([type:extendp(x)],
30 cond(type=false,not_an_extend(alterant,x),
32 type#expected_extend_type,
33 error("Attempt to apply",alterant,"to alter",X,
34 "Expected MACSYMA EXTEND type was:",expected_extend_type)))$