[EMAIL PROTECTED] wrote:

> Hi, Elan,

I'm not Elan, but I'd like to add my two cents. :-)

> 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"

It is allowed, but don't forget that REBOL is a context sensitive
language. The word 'f you used above, will have different values
in different function calls, but its context is always the same (a
function's context is static).
    To avoid the problem you're having, try:

 samef: func [f [any-function!]] [func [x] reduce [:f 'x]]

> environment - which in turn means that you cannot *in general* return a
> function as a result of evaluation of a function.

That's not the problem. The problem is about that word 'f, which
will be always bound to the same context.

Ciao,
    /Gabriele./
o--------------------) .-^-. (----------------------------------o
| Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila |
| GIESSE on IRC     \ \-\_/-/ /  http://www.amyresource.it/AGI/ |
o--------------------) `-v-' (----------------------------------o

Reply via email to