On 1/5/06 12:07 PM, "Mark Wieder" <[EMAIL PROTECTED]> wrote:
> What I'm
> looking at for this case is not just polymorphism, but being able to
> overload functions whose default instance is in my mainstack and whose
> overloaded instance is in a separate (not sub-) stack.
If the handlers in your main stack check the target, then they can provide
the default implementations:
function foo p
put the uStack of me into tStack
if (tStack is empty) \
or (the target is "stack" && quote & tStack & quote) then
-- execute the default implementation, for example:
put the long time into tResult
else
put value(the params,stack tStack) into tResult
end if
return tResult
end foo
on bar p
put the uStack of me into tStack
if (tStack is empty) \
or (the target is "stack" && quote & tStack & quote) then
-- execute the default implementation, for example:
put the long time into tResult
else
send the params to stack tStack
put the result into tResult
end if
put tResult
return tResult
end bar
With this technique, you can overload any handler without repeatedly
removing and inserting scripts into front or back. I think. I see you're
satisfied with your current approach, but do you see a problem with this
technique?
-- Dick
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution