Hashes and arrays:
myHash = [key: value, key: value]
myArray = [value, value, value]
What we get out of these.
-- The ability to compare two separate totals eg. Comparing prices of a set of products from two different stores.
-- The ability display the difference of the values of two hashes that have matching keys.
-- The ability to collect data that we calculate in an easy to reason about object and then display those values later in the page within text. (this would be in valuable when combined with hiding calculations)
Personally I would implement his as a singe type like PHP's arrays which can be indexed or hashed.
No need to introduce loops, just some pre defined iterators:
## Mathematical operators
Iterates both hashes and where keys match, execute the operator used.
eg. hash1 + hash2: iterates both hashes and returns a new hash were matching keys have been added together
## sum
iterates the hash or array returning a the sum of the values in the array or hash
## Average
iterates the hash or array and gives the average of the values.
## Display
Banana Cream Pi
scale = 1
crust = []
meringue = []
filling = []
crust[flower] = 1 cup * scale
crust[butter] = 0.5lbs * scale
meringue[eggwhites] = 8 * scale
meringue[sugar] = 1 cup * scale
filling[bananas] = 4 * scale
filling[sugar] 1 cup * scale
filling[gelatin] 2 tblsp* scale
Ingredients:
## Crust
flower crust[flower]
butter crust[butter]
etc...
Begin by making your crust put crust[flower] flower and crust[butter] softened butter in a large mixing bowl. etc...