Category talk:Wren-seq: Difference between revisions

Content added Content deleted
(→‎Source code: Bug fix)
(→‎Source code: Added Seq.peek)
Line 70: Line 70:
}
}
return SkipSequence.new(s, count)
return SkipSequence.new(s, count)
}

// Returns the first element of a sequence without removing it.
// Returns null if the sequence is empty.
static peek(s) {
isSeq_(s)
for (value in s) {
return value
}
return null
}
}