Overwrite builtin Functions



> How can I overwrite a Maxima functions, e.g. to extend its functionality, something like
> hessian(f,[v]) := if length(v)=0 then hessian(f,listofvars(f)) else hessian(f,v[1])
> Wouldn't that be a recursive definition?

Indeed, your definition of hessian can cause an infinite loop. Your options:

(1) name your function something like my_hessian; for example

my_hessian(f,[v]) := if emptyp(v) then hessian(f, block([listconstantvars : false], listofvars(f))) 
    else if emptyp(rest(v)) then  hessian(f, first(v)) else error("huh?");

(2) Modify the definition of hessian (defined in share/linearalgebra/linalg-extra.lisp). Either you'll
need to live with the inconsistency between your hessian and Maxima, or try to convince the Maxima
developers that your definition is better.
 

--Barton