[REBOL] Function Inheritance
From: lmecir::mbox::vol::cz at: 10-Mar-2003 16:09
me and Romano are helping Gabriele to do some type definition experiments in Rebol.
Gabriele wanted to have a "function inheritance" HOF like SUBFUNC or TSUBFUNC as follows:
>> tinsert: tsubfunc :insert load mold third :insert [print Inserting...
>> head tinsert/only  
>> head tinsert  
The only thing needed is to call SUPER without any arguments/refinements and the parent
obtains all the arguments and refinements automatically. The sources of the functions
If you want to be able to use all argument handling methods (i.e. not just the normally
evaluated arguments), you can use FUNCALL5 and PREPARE-AR5 (which support even unevaluated/fetched
argument passing methods) instead of FUNCALL and PREPARE-AR, but it will be slower.
The same holds for SUBFUNC and TSUBFUNC. TSUBFUNC is more reliable (no problem with error
and set-word handling, etc.), but slower.