Category talk:Wren-seq: Difference between revisions

→‎Source code: Lst.indicesOf should return a list of 3 arguments, not 2.
(Added source code for new 'Wren-seq' module.)
 
(→‎Source code: Lst.indicesOf should return a list of 3 arguments, not 2.)
Line 59:
var count = a.count
var indices = []
if (count == 0) return [false, 0, indices]
if (start >= 0) {
if (start >= count) return [false, 0, indices]
for (i in start...count) {
if (a[i] == value) indices.add(i)
Line 67:
} else {
start = count + start
if (start < 0) return [false, 0, indices]
for (i in start..0) {
if (a[i] == value) indices.add(i)
}
}
if (indices.isEmpty) return [false, 0, indices]
return [true, indices.count, indices]
}
 
9,482

edits