Shopify/batman — pull request #178 by pvande (2011-10-13 18:47:25+00:00)
Title: Properly Lazy Properties

This was begun initially to fix #177 (which it does), but simplifies much of the logic around properties while deferring (potentially) expensive accessor calls as long as possible.

A good piece of the remaining complexity comes from maintaining the contract that the callback passed to `Property::observe` should receive the current value when fired. This is actually overkill for many observers, but is relied upon by enough of the core library (and tests!) that I opted not to fight against it. (The possibility of a lazier `::observe` in the future still exists.)

Please help me get as many eyes on this as possible. While it works for everything I've thrown against it, I'd prefer not to break things too badly.