On 5/17/06, Jorge Godoy <[EMAIL PROTECTED]> wrote: > Fromwhat I understood, this looks like a Python decorator.
Not exactly. A Python decorator is a function that takes another function as an argument, and returns a function. When composing functions f and g, g needs to take an argument of type B, and return a single value of some type C. The function f needs to take one argument of type A and return something of type B. The result of the composition is a function h that takes an argument of type A and returns a value of type C. B -(via f)-> C A -(via g)-> B h = f o g : A -(via g)-> B -(via f)-> C Think of composition as a pipeline of functions: compose(f1, f2, ..., fN) returns a function that puts it argument backwards through the pipline, applying fN, then fN-1 to the result etc. Arnar --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MochiKit" 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/mochikit -~----------~----~----~----~------~----~------~--~---
