Hi,
> Thanks, Julian, for the reducidation elucidation!
>
> >> make-adder: func [x] [ func [y] [+ x y] ]
>
> >> reduce [make-adder 6 5]
> == [func [y][+ x y] 5]
>
>
> by the way,
>
> >> reduce reduce [make-adder 6 5]
> == [11]
>
> got to love that old 'reduce
>
> -galt
>
The problem is, that Make-adder is unreliable, see this:
add6: make-adder 6
add5: make-adder 5
>> add6 1
== 6
>> add5 1
== 6
The working approach:
make-adder: func [x] [func [y] compose[+ (:x) y]]
Regards
Ladislav
- [REBOL] func[func] Re:(2) Galt_Barber
- lmecir
