How DWiki uses partial function evaluationDecember 9, 2006
As part of a longer entry, Muharem Hrnjadovic asks:
I'm not sure that my example qualifies, but I'll take a shot at it. DWiki has a WSGI-like processing pipeline to handle requests; they get passed from function to function, possibly getting mutated on the way down and possibly having the results mutated on the way back up. The pipeline functions look like this:
Notice how The answer is partial function evaluation. All of the DWiki predates Python 2.5 and the functools module, so
it currently uses a closure and lambda-based approach. However,
(This can also be written as a One of the small issues with DWiki's current lambda-based approach is that stack backtraces are somewhat confusing and overly verbose, since they alternate real functions with the lambdas that wrap them. One potential advantage of a real implementation of partial function evaluation is avoiding this, although I suspect that the current implementation doesn't. (3 comments.)
Written on 09 December 2006.
|
These are my WanderingThoughts GettingAround This is part of CSpace, and is written by ChrisSiebenmann. * * * Atom feeds are available; see the bottom of most pages. Categories: links, linux, programming, python, snark, solaris, spam, sysadmin, tech, unix, web |