DEFN _ _ _ _ _ _ _ _ _ _ _ _ switch
When the switch defn is on, the Standard Lisp equivalent of the input statement or procedure is printed, but not evaluated. Default is off.
on defn; 17/3; (AEVAL (LIST 'QUOTIENT 17 3)) df(sin(x),x,2); (AEVAL (LIST 'DF (LIST 'SIN 'X) 'X 2)) procedure coshval(a); begin scalar g; g := (exp(a) + exp(-a))/2; return g end; (AEVAL (PROGN (FLAG '(COSHVAL) 'OPFN) (DE COSHVAL (A) (PROG (G) (SETQ G (AEVAL (LIST 'QUOTIENT (LIST 'PLUS (LIST 'EXP A) (LIST 'EXP (LIST 'MINUS A))) 2))) (RETURN G)))) ) coshval(1); (AEVAL (LIST 'COSHVAL 1)) off defn; coshval(1); Declare COSHVAL operator? (Y or N) n procedure coshval(a); begin scalar g; g := (exp(a) + exp(-a))/2; return g end; COSHVAL on rounded; coshval(1); 1.54308063482
The above function coshval finds the hyperbolic cosine (c osh) of its argument. When defn is on, you can see the Standard Lisp equivalent of the function, but it is not entered into the system as shown by the message Declare COSHVAL operator?. It must be reentered with defn off to be recognized. This procedure is used as an example; a more efficient procedure would eliminate the unnecessary local variable with
procedure coshval(a); (exp(a) + exp(-a))/2;