spencersalazar / chuck

28 stars 8 forks source link

array.clear() #13

Closed spencersalazar closed 10 years ago

spencersalazar commented 10 years ago

The following code:

string a[3];
<<< a.cap() >>>;
a.clear();
<<< a.cap() >>>;

prints: 3 :(int) 3 :(int)

shouldnt clear() completely empty the array?

heuermh commented 10 years ago

For what it is worth, I use a.size(0); instead of a.clear();

https://github.com/heuermh/lick/blob/master/ArrayList.ck#L37

spencersalazar commented 10 years ago

Ah yes, thanks for pointing that out -- thats what I do to and it works well. I suppose the bug in this case is more that the intended functionality and purpose of array.clear() is, well, unclear.