Christopher Arndt schrieb:
> Great. Now if we just could remove RuleDispatch easily too! :-) I had a 
> look yesterday where it is exactly used in TG and some of the code makes 
> my hair stand on end. Too clever for it#s own good, IMHO. For example, 
> does anyone understand how errorhandling.py exactly works? Might it be 
> possible to replace some of the dispatch uses with simplegeneric or 
> PEAK-rules?

We will probably need PEAK-rules, simplegeneric looks too simple.

I just experimented a bit with errorhandling.py. It has two generic 
functions, dispatch_error and dispatch_failsafe.

It was very easy to rewrite failsafe using PEAK-rules:
http://paste.turbogears.org/paste/2492

Unfortunately, dispatch_error is trickier since it is not an ordinary 
generic function, but a MultiorderGenericFunction, and since 
register_handler is doing some weird stuff. Needs work.

And there are a few other places where RuleDispatch is used, which look 
even weirder, e.g. the implementatino of the expose decorator.

-- Christoph



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to