Hi, Rebols,
look at this example:
;Identity function, simply duplicates it's input
id: func [x [number!]] [:x]
;Increment function, increases it's input by one
inc: func [x [number!]] [x + 1]
;The same function as argument
samef: func [f [any-function!]] [func [x] [f x]]
a: samef :id
;and now it comes:
>> a: samef :id
>> a 1
== 1
>> a 2
== 2
>> b: samef :inc
>> b 1
== 2
>> b 2
== 3
>> a 1
== 2
I am calling this behaviour the non-reentrant function calling, because
after you reenter the samef, previous result gets wrong
-Ladislav