Hi, Elan,

As I understand now, your point of view is, that the definition:


samef: func [f [any-function!]] [func [x] [f x]] ; (1)

isn't allowed in Rebol "because it doesn't work in Rebol for some reasons
..." (not trying to be personal, just explaining my understanding of what
you wrote), so, in short: "not a bug, a feature"

My point was different:

the above definition doesn't work in Rebol, so that means that Rebol
function calling is non-re-entrant, or, if you prefer - with static
environment - which in turn means that you cannot *in general* return a
function as a result of evaluation of a function.

In other words, *there are cases when you cannot return a function a a
result of evaluation of a function*.

To show some examples:

you cannot create a curried function in Rebol (- even though you can easily
write it in Rebol), you cannot define a composition function, i.e. this:

o: func [f [function!] g [function!]] [func [x] [f g x]]

, because it wouldn't work and many others, that you can easily represent
with an expression like (1), so, shortly speaking: "not a feature, a bug"

-Ladislav

Reply via email to