Assigning a function ?



Hi all,

I'm fairly new to maxima, but could not really find a solution to my  
problem in the archives or in the friendly manual...

I'm trying the following:

g(x):=x^3;
dg(x):=diff(g(x),x,1);
dg(0);

This fails when evaluating dg(0) with:
diff:  second argument must be a variable; found 0

I tried using the single quote operator, lambda expressions but could  
not make it work.

I found a workaround using arrays of functions but would prefer a  
direct method:
ddg[n](x):=diff(g(x),x,1);
ddg[0](0);

Any help would be much appreciated, best regards,

Laurent