1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
module sdml_sequence_ordered is
import skos
class Ordered is
def drop (count → unsigned) → Self is
@skos:definition = "Drop ~count~ items from the beginning of the sequence and return the rest."@en
end
def get (index → unsigned) → {0..1} Self is
@skos:definition = "Return the element in this sequence at the position ~index~."@en
end
def reverse → Self is
@skos:definition = "Return a new sequence with the order of elements reversed."@en
end
def slice (start → unsigned count → unsigned) → Self :=
take(drop(vs count) start) is
@skos:definition = "Return a sub-sequence of ~count~ elements starting at ~start~."@en
end
def take (count → unsigned) → Self is
@skos:definition = "Return ~count~ items from the beginning of the sequence and discard the rest."@en
end
end
end
|