using functions as arguments



Hi everybody,

Some arguments of a user-defined function can be functions:
----------------------------------------
C1) double(f,a):=2*f(2*a);
(D1)                double(f, a) := 2 f(2 a)
(C2) double(sin,%pi/3);
(D2)                     SQRT(3)
----------------------------------------

A function can be defined as the derivative of another one:
----------------------------------------
(C3) sin2x2(x):=2*sin(x2);
                       2
(D3)                 sin2x2(x) := 2 SIN(x )
(C4) df(x):=''(diff(sin2x2(x),x));
                          2
(D4)                  df(x) := 4 x COS(x )
(C5) df(3);
(D5)                    12 COS(9)
----------------------------------------
The previous construction can be used in the definition of a function:
----------------------------------------
(C6) N(a):=block(dg(x):=''(diff(sin2x2(x),x)),dg(2*a));
                        2
(D6)          N(a) := BLOCK(dg(x) := 4 x COS(x ), dg(2 a))
(C7) N(3);
(D7)                   24 COS(36)
-----------------------------------------
So i don't understand why this does not work:
-----------------------------------------
(C8) Nf(f,a):=block(fd(x):=''(diff(f(x),x)),fd(a+5));
                                                              d
(D8)            Nf(f, a) := BLOCK(fd(x) := -- (f(x)), fd(a + 5))
                                                             dx
(C9) Nf(sin,3);
Attempt to differentiate with respect to a number:
8
#0: fd(x=8)
#1: Nf(f=SIN,a=3)
-- an error.  Quitting.  To debug this try DEBUGMODE(TRUE);)
-------------------------------------------
Can anybody give me the correct syntax.
Thanks in advance,
JDF