texmacs and maxima behave differently when loading function



I'm trying to load the following function called critpt.max (based 
on an example by  Richard Rand).
When starting maxima I get the following:
coolens at antec:~$ maxima
Maxima restarted.
(%i1) batch ("/home/coolens/maxima/critpt.max");
batching #p/home/coolens/maxima/critpt.max
(%i2) critpt() := (PRINT("program to find critical point"),
f : READ("enter f(x)"), PRINT("f = ", f), eq : [DIFF(f, x)], unk : [x],
SOLVE(eq, unk))
(%i3)

When I do the same in texmacs, the program seems to wait forever and never 
shows (%i3)

Does anyone know here how to make things work from within texmacs?

regards,
hugo


Here is the function:
critpt():=(
print("program to find critical point"),
/* 
---------------------------------------------------------------------------
asks for a function
--------------------------------------------------------------------------- 
*/
f:read("enter f(x)"),
/* 
---------------------------------------------------------------------------
echoes it, to make sure
--------------------------------------------------------------------------- 
*/
print("f = ",f),
/* 
---------------------------------------------------------------------------
produces a list with derivative of f
--------------------------------------------------------------------------- 
*/
eq:[diff(f,x)],
/* 
---------------------------------------------------------------------------
produces a list of unknowns
--------------------------------------------------------------------------- 
*/
unk:[x],
/* 
---------------------------------------------------------------------------
solves the system
--------------------------------------------------------------------------- 
*/
solve(eq,unk)
)$