You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is some kind of problem related to cloning. The following from Template_Valid_29 illustrates:
public type Vector<T> is { T[] items, int length } where length <= |items|
function add<T>(Vector<T> vec, T item) -> Vector<T>:
//
if vec.length == |vec.items|:
// vec is full so must resize
int nlen = (vec.length*2)+1
// double size of internal array
T[] nitems = [item; nlen]
int i = 0
// copy items
while i < vec.length:
nitems[i] = vec.items[i]
i = i + 1
//
vec.items = nitems
else:
vec.items[vec.length] = item
//
vec.length = vec.length + 1
//
return vec
As far as I can tell, the generated JavaScript seems to be correct. However, subsequent calls of this result in interference between Vectors which should be disjoint.
The text was updated successfully, but these errors were encountered:
There is some kind of problem related to cloning. The following from
Template_Valid_29
illustrates:As far as I can tell, the generated JavaScript seems to be correct. However, subsequent calls of this result in interference between
Vector
s which should be disjoint.The text was updated successfully, but these errors were encountered: