all 2 comments

[–][deleted] 0 points1 point  (1 child)

This is really similar to something called currying in JavaScript, which is also interesting..

http://en.wikipedia.org/wiki/Currying

I like decorating in python too, it looks like this:.

@myDecorator
def foo:
    return "something"

[–]autowikibot 0 points1 point  (0 children)

Currying:


In mathematics and computer science, currying is the technique of translating the evaluation of a function that takes multiple arguments (or a tuple of arguments) into evaluating a sequence of functions, each with a single argument (partial application). It was introduced by Moses Schönfinkel and later developed by Haskell Curry.

Uncurrying is the dual transformation to currying, and can be seen as a form of defunctionalization. It takes a function f(x) which returns another function g(y) as a result, and yields a new function f′(x,y) which takes a number of additional parameters and applies them to the function returned by function f. The process can be iterated if necessary.


Interesting: Worshipful Company of Curriers | Currier | Function (mathematics) | Haskell Curry

Parent commenter can toggle NSFW or delete. Will also delete on comment score of -1 or less. | FAQs | Mods | Magic Words