Returns a FoscSequence.
A sequence.
| == | |
| != | |
| ++ | |
| add | |
| addAll | |
| any | |
| at | |
| atAll | |
| copySeries | |
| do | |
| doAdjacentPairs | |
| every | |
| first | |
| flat | |
| flatten | |
| hash | !!!TODO: not yet implemented |
| includes | |
| insert | |
| indexOf | |
| isEmpty | |
| last | |
| lastIndex | |
| notEmpty | |
| put | |
| remove | |
| removeAt | |
| reverseDo | |
| separate | Groups items by predicate function. |
| size |
Example
a = FoscSequence(#[1,2,3]);
b = FoscSequence(#[1,2,3]);
c = FoscSequence([1,2,4]);
a == b;true
a == c;falseExample
a = FoscSequence(#[1,2,3]);
b = FoscSequence(#[1,2,3]);
c = FoscSequence([1,2,4]);
a != b;false
a != c;trueExample
a = FoscSequence(#[1,2,3]);
b = FoscSequence([4,5,6]);
c = a ++ b;
c.items;[ 1, 2, 3, 4, 5, 6 ]Example
a = FoscSequence(#[1,2,3]);
a.add(4);
a.items;[ 1, 2, 3, 4 ]Example
a = FoscSequence(#[1,2,3]);
a.addAll([4,5]);
a.items;[ 1, 2, 3, 4, 5 ]Example
a = FoscSequence(#[1,2,3]);
a.any { |item| item == 1 };true
a.any { |item| item == 4 };falseExample
a = FoscSequence(#[1,2,3]);
a[1];2Example
a = FoscSequence(#[1,2,3]);
a.atAll(#[0,2]);[ 1, 3 ]
a.atAll(#[0,3]);[ 1, nil ]Example
a = FoscSequence(#[1,2,3]);
a[1..];[ 2, 3 ]Example
a = FoscSequence(#[1,2,3]);
a.do { |each, i| [each, i].postln };FoscSequence.newExample
a = FoscSequence(#[1,2,3]);
a.doAdjacentPairs { |a, b, i| [a, b, i].postln };FoscSequence.newExample
a = FoscSequence(#[1,2,3]);
a.every { |item| item < 4 };true
a.every { |item| item > 2 };falseExample
a = FoscSequence(#[1,2,3]);
a.first;1Example
a = FoscSequence(#[[1, 2, 3], [[4, 5], [[6]]]]);
b = a.flat;
b.items;[ 1, 2, 3, 4, 5, 6 ]Example
a = FoscSequence(#[[1, 2, 3], [[4, 5], [[6]]]]);FoscSequence.new
b = a.flatten(1);
b.items;[ 1, 2, 3, [ 4, 5 ], [ [ 6 ] ] ]
c = a.flatten(2);
c.items;[ 1, 2, 3, 4, 5, [ 6 ] ]!!!TODO: not yet implemented
Example
a = FoscSequence(#[1,2,3]);
a.includes(2);true
a.includes(4);falseExample
a = FoscSequence(#[1,2,3]);
a.insert(1, 4);
a.items;[ 1, 4, 2, 3 ]Example
a = FoscSequence(#[1,2,3]);
a.indexOf(2);
a.indexOf(4);Example
a = FoscSequence(#[1,2,3]);
a.isEmpty;false
a = FoscSequence([]);
a.isEmpty;trueExample
a = FoscSequence(#[1,2,3]);
a.last;3Example
a = FoscSequence(#[1,2,3]);
a.lastIndex;2Example
a = FoscSequence(#[1,2,3]);
a.notEmpty;true
a = FoscSequence([]);
a.notEmpty;falseExample
a = FoscSequence(#[1,2,3]);
a[1] = 4;
a.items;prFormatCodeString interpret initial failed: a PrimitiveFailedError
a = FoscSequence(#[1,2,3]);
a[1] = 4;
Example
a = FoscSequence(#[1,2,3]);
a.remove(3);
a.items;prFormatCodeString interpret initial failed: a PrimitiveFailedError
a = FoscSequence(#[1,2,3]);
a.remove(3);
Example
a = FoscSequence(#[1,2,3]);
a.removeAt(1);
a.items;prFormatCodeString interpret initial failed: a PrimitiveFailedError
a = FoscSequence(#[1,2,3]);
a.removeAt(1);
Example
a = FoscSequence(#[1,2,3]);
a.reverseDo { |each, i| [each, i].postln };FoscSequence.newGroups items by predicate function.
Example
a = FoscSequence([1,2,3,5,6]);
b = a.separate { |a, b| (b - a) >= 2 };
b.items;[ [ 1, 2, 3 ], [ 5, 6 ] ]Example
a = FoscSequence(#[1,2,3]);
a.size;3