Vector: Difference between revisions

Jump to navigation Jump to search
No change in size ,  3 February 2022
m
v.vector(1) is wrong, vector is not a function of std.Vector, it is the like the name suggest of type vector and accessing elements is done with square brackets: v.vector[1]
No edit summary
m (v.vector(1) is wrong, vector is not a function of std.Vector, it is the like the name suggest of type vector and accessing elements is done with square brackets: v.vector[1])
 
Line 99: Line 99:
var v = std.Vector.new(['a', 'b', 'c']);
var v = std.Vector.new(['a', 'b', 'c']);


var result = v.vector(1);
var result = v.vector[1];
assert(result == "b");
assert(result == "b");
</syntaxhighlight>
</syntaxhighlight>

Navigation menu