Re: RosettaCode
- Posted by DerekParnell (admin) Jan 26, 2011
- 1981 views
mattlewis said...
bruce1961 said...
Nice to see some folk have taken up the challenge.
Is it fair enough to assume that Function Composition is impossible in Euphoria?
No, you can do it using routine_ids:
function compose( integer f, integer g, object x ) return call_func( f, {call_func( g, {x} )} ) end function
As has been said earlier, Euphoria does not support this (yet).
What is needed is ...
- the ability to get the routine_id of a built-in
- a built-in routine like routine_id() that operates like this ...
integer new_rid = eu:compose(f, g)
Where 'f', and 'g' can be either routine_ids or names of routines.