[REBOL] Re: Retrieve function name
From: al:bri:xtra at: 25-Oct-2001 9:20
> Now I have to explicit write the name for every function. What I would
> like is something like:
>
> first-function: func [] [
> profiler rejoin [ "> " :name-of-function ]
>
> do som stuff here...
>
> profiler rejoin [ "< " :name-of-function ]
> ]
Would something like this help?
>> profiler: func ['f [word!]][
[ print [">" f]
[ probe get f
[ print ["<" f]
[ ]
>> profiler transpose
> transpose
func [
"Transposes a Matrix's rows and columns."
[catch]
Matrix [block!] "The Matrix." /local
Rows Columns Transposed][
throw-on-error [
Rows: length? Matrix
Columns: length? Matrix/1
Transposed: array reduce [Columns Rows]
repeat Row Rows [
repeat Column Columns [
poke pick Transposed Column Row pick pick Matrix Row Column
]
]
Transposed
]
]
< transpose
I hope that helps!
Andrew Martin
ICQ: 26227169 http://valley.150m.com/