benhamill/assembler — pull request #21 by benhamill (2014-05-15 04:58:05+00:00)
Title: This is why mutablility is a bad thing

```ruby
class Foo
exend Assembler
assemble_from bars: []
end

foo_1 = Foo.new do |b|
b << "foo_1's bar"
end

foo_2 = Foo.new
foo_2.bars # => ["foo_1's bar"]
```

So to recap, if we define default values that are mutable and someone instantiates an object with the default value and then mutates it, that change will be shared by every instance of the class with the default value.

This seems like a show-stopper, it's already caused bugs in two projects. I'm not sure how to fix it - I'm leaning towards making `assemble_from` accept a block that's called in `initialize` each time.

Thoughts?

ps - This would never have happened in Clojure™ ;)