Josef Eschgfaeller on Fri, 13 Feb 2015 12:23:52 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Function names


Is there a way to obtain the name
of a function as a string? I would like
to generate an output of the form
--------------------------------------------------
f   3
g  9
h 27
--------------------------------------------------
after
--------------------------------------------------
f (x) = x
g (x) = x^2
h (x) = x^3

F=[f,g,h]
for (i=1,3, f=F[i]; print(Strprintf("%s: %d",f,f(3))))
--------------------------------------------------
But this (as happens with Str(f)) prints the
function bodies.

Thanks
Josef Eschgfaeller