the-grid / Flowerflip

Layout solver
MIT License
12 stars 4 forks source link

Mutability #27

Open paulyoung opened 9 years ago

paulyoung commented 9 years ago

The data parameter of promises is the only mutable object in decision trees.

How are other objects made immutable? e.g. choice

paulyoung commented 9 years ago

Items are immutable, meaning they will always remain in the Choice.attributes.items object

cbchouinard commented 9 years ago

I'll clarify that point in the doc, in fact even items are not immutable, its the collection of items that is. eating an items add the item to the eatenItems collection and when you get an item, the list of available items is filtered out from the eatenItems collection.