Associative array/Merging: Difference between revisions
Content added Content deleted
Line 1,189: | Line 1,189: | ||
=={{header|Smalltalk}}== |
=={{header|Smalltalk}}== |
||
<lang smalltalk></lang> |
<lang smalltalk></lang> |
||
base := Dictionary withAssociations:{ |
|||
'name'-> 'Rocket Skates' . |
|||
'price' -> 12.75 . |
|||
'color' -> 'yellow' }. |
|||
update := Dictionary withAssociations:{ |
|||
'price' -> 15.25 . |
|||
'color' -> 'red' . |
|||
'year' -> 1974 }. |
|||
result := Dictionary new |
|||
declareAllFrom:base; |
|||
declareAllFrom:update. |
|||
Transcript showCR: result.</lang> |
|||
{{out}} |
{{out}} |
||
<pre>Dictionary(name->Rocket Skates price->15.25 year->1974 color->red)</pre> |
|||
<pre></pre> |
|||
=={{header|Swift}}== |
=={{header|Swift}}== |