1,830 karma · joined Mar 6, 2008 (18y ago) · 493 submissions
comment 15y ago · link · parent
That's over $400 per incident. Either people carry a hell of a lot of cash on them or there are some outliers with some interesting stories to tell.
comment 15y ago · link · parent
A macro is going to be evaluated at compile time and will result in a matching pattern (often something that is structured like a function call) being expanded into some other construct that will be evaluated at runtime.
A decorator is going to be evaluated at compile time and will result in a decorated function being "expanded" into another function which will be evaluated at runtime.
No, they aren't the same thing. How could they be? The languages are different. But there is an underlying affinity.
comment 15y ago · link · parent
What you can do though is define behavior that varies based on the context. For example in Python you don't have function overloading or types, but with a decorator you can effectively create that type of behavior. So while you're not changing the language, you are changing the semantics of the functions you decorate.
comment 15y ago · link · parent
Decorators ultimately result in a function that is a substitute for another function. That function can have all sorts of wonderful runtime behavior, including access to arguments, the call stack, and other functions. Dismissing them as "adding stuff that happens every time the function is called" misses an entire dimension of their utility.
comment 15y ago · link · parent
comment 15y ago · link · parent
comment 15y ago · link · parent
comment 15y ago · link · parent
comment 16y ago · link · parent
I'm not looking to second guess each of your examples, many of which were fine. I felt that your currying example was trying to bring in a purely functional toolkit ala Lisp when it wasn't appropriate. Function composition (which you allude to in your reply, yet I don't see) and blocks (especially!) show off Ruby's functional capabilities quite well and would be just as effective and more practical.
Btw, if you're quite new to Python, do yourself a favor and learn about list comprehensions. They can be quite wonderful.
Good luck!
comment 16y ago · link · parent
Ivan Sutherland in 1962 is what I think of when I hear that phrase: http://www.youtube.com/watch?v=mOZqRJzE8xg
comment 16y ago · link · parent
AboutUs is hiring.
http://www.aboutus.org/AboutUs.org/Jobs
We're a good team looking for at least one new member. We're a Rails shop but you'll have to bring a lot more than Rails chops to make the cut.
AboutUs is a startup, but it's a very stable startup. The company has been around for four years and is venture backed. Many of us have families and all of us have lives outside of work.
We write a lot of code. We pair. We test. We deploy to a live site many times each day. We also wrestle daily against a tough legacy codebase and awkward (but improving!) infrastructure. Greenfield hackers won't dig it; refactoring hackers will.
The job is onsite (no telecommute) in Portland, Oregon. Many of us bike to work. There is weekly yoga. Daily ping pong. I think we have a vegan around here somewhere. And sometimes beer mysteriously appears in the fridge.
comment 16y ago · link · parent