Hi, Jeff,
your approach (almost) works, you didn't misuse anything. The problem shows
mainly, if you have to write it like this:
composite: func [f [function!] g[function!]] [...], then you are out of luck
But some nit-picking: even if you do it like this, you do not get a function
as result (Hint: function must have only one value f x for a fixed x.)
Ladislav
I know that in Rebol you can write a work-around to emulate curried
functions, if you supply some suitable words as parameters (one may be
enough), but it's only a work-around as here, because the original bug
remains...
Howdy Ladislav and Elan:
Not eager to jump into this fray, but:
> ... 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]]
Maybe I am missing the point, but what's wrong with:
composite: func ['f 'g][func [x] compose [(f) (g) x]]
secfirst: composite first second
thircond: composite second third
secfirst ["abc" "def" "ghi"]
== #"d"
thircond ["abc" "def" "ghi"]
== #"h"
There are also various ways in REBOL to emulate curried
functions.
Sorry if I'm missing somehting, jumping in here. Haven't
really followed your thread very deeply so far, so please
forgive me if I missed the mark.
-jeff