Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
sav08:semantics_of_array_manipulations [2008/04/08 20:20] vkuncak |
sav08:semantics_of_array_manipulations [2008/04/08 20:51] vkuncak |
||
---|---|---|---|
Line 4: | Line 4: | ||
Example: | Example: | ||
- | ++++| | + | |
a = new T[10]; | a = new T[10]; | ||
b = new T[10]; | b = new T[10]; | ||
+ | ++++| | ||
a = b; | a = b; | ||
i = j; | i = j; | ||
++++ | ++++ | ||
- | |||
a[i] = 1; | a[i] = 1; | ||
b[j] = 2; | b[j] = 2; | ||
assert a[i]==1; | assert a[i]==1; | ||
+ | |||
+ | One possible model: ++| arrays :: Obj \times Int \to Obj++ | ||