3 /* DEFAR(FOO,[X,Y],X+Y) Defines a function FOO and an array FOO.
4 This allows you more flexibility than you get with straight
5 macsym array functions. It is possible to reset the array
6 without killing the function.
8 -GJC 8:54am Friday, 5 September 1980
12 /* commented out of DOE MACSYMA
13 EVAL_WHEN([translate,batch,demo],
14 IF GET('MACRO1,'VERSION) = FALSE
15 THEN LOADFILE(MACRO1,FASL,DSK,SHARE),
16 IF GET('SUBMAC,'VERSION) = FALSE
17 THEN LOADFILE(SUBMAC,FASL,DSK,SHARE2))$ */
20 /* commented out of DOE MACSYMA
21 EVAL_WHEN(TRANSLATE,PACKAGEFILE:TRUE,SAVEDEF:FALSE)$ */
23 defar('name,'argl,'body)=>
25 block([%_val:block([?evarrp:true],name[splice(argl)])],
26 if %_val='?notexist then
27 (%_val:body,name[splice(argl)]:%_val,%_val)
29 /* kludge to init the array, (as a hashed array). */
30 name[splice(argl)]:'?notexist,
35 defar(legend,[n],((2*n-1)*'x*legend(n-1)-(n-1)*legend(n-2))/n),
37 (legend[0]:rat(1), legend[1]:rat('x)));
39 eval_when(demo,legend(5));