public IVarTuple this[Range range] { get { int lenHead = this.Head.Count; int lenTail = this.Tail.Count; (int offset, int count) = range.GetOffsetAndLength(lenHead + lenTail); if (count == 0) { return(STuple.Empty); } if (offset == 0) { if (count == lenHead + lenTail) { return(this); } if (count == lenHead) { return(this.Head); } } if (offset == lenHead && count == lenTail) { return(this.Tail); } return(TupleHelpers.Splice(this, range)); } }
public IVarTuple this[Range range] { get { int d = this.Depth; (int offset, int count) = range.GetOffsetAndLength(d + 1); if (count == 0) { return(STuple.Empty); } if (count == 1 && offset == d) { return(new STuple <T>(this.Tail)); } if (offset == 0) { if (count == d + 1) { return(this); } if (count == d) { return(this.Head); } } return(TupleHelpers.Splice(this, range)); } }
public IVarTuple this[int?fromIncluded, int?toExcluded] => TupleHelpers.Splice(this, fromIncluded, toExcluded);
public ITuple this[int?fromIncluded, int?toExcluded] { get { return(TupleHelpers.Splice(this, fromIncluded, toExcluded)); } }