RangeFrom

public struct RangeFrom[T] where T: Steppable, T: Comparable { /* private fields */ }

Partial range [start, +∞) — produced by the postfix .. operator.

RangeFrom is Iterable and produces an infinite iterator. Use break to terminate iteration.

Examples

for i in 0.. { if i >= 5 { break; } print(i) } (10..).contains(42) // true

Representation

Single value: start. No heap allocation.

Properties

public var start: T

Lower bound — included in the range.

Initializers

public init(T)

Methods

public func contains(T) -> Bool

Returns true iff value >= start.

ImplementsEquatable

Associated Types

type Output = Bool

Methods

public func equal(to: Self) -> Bool

Bridges Equal.equal(to:) to Equatable.isEqual(to:).

public func isEqual(to: RangeFrom[T]) -> Bool

Structural equality.

public func notEqual(to: Self) -> Bool

Default !=: delegates to == so there's a single source of truth.

ImplementsIterable

Associated Types

type Item = T
type TargetIterator = RangeFromIterator[T]

Methods

public func iter() -> RangeFromIterator[T]

Returns a fresh infinite iterator starting at start.

ImplementsSeqIndex

Associated Types

type SeqOutput = ArraySlice[T]

Methods

public func readSeq(from: ArraySlice[T]) -> ArraySlice[T]
public func readSeqChecked(from: ArraySlice[T]) -> ArraySlice[T]?
public func readSeqUnchecked(from: ArraySlice[T]) -> ArraySlice[T]
public func writeSeq(to: ArraySlice[T], with: ArraySlice[T])
public func writeSeqUnchecked(to: ArraySlice[T], with: ArraySlice[T])

ImplementsSeqRange

Methods

public func resolve(Int64) -> Range[Int64]

ImplementsBytesIndex

Associated Types

type BytesYield = BytesView

Methods

public func readBytes(from: BytesView) -> BytesView
public func readBytesChecked(from: BytesView) -> BytesView?
public func readBytesUnchecked(from: BytesView) -> BytesView

ImplementsBytesClampable

Associated Types

type BytesClampedYield = BytesView

Methods

public func readBytesClamped(from: BytesView) -> BytesView

ImplementsBytesWrappable

Associated Types

type BytesWrappedYield = BytesView

Methods

public func readBytesWrapped(from: BytesView) -> BytesView

ImplementsBytesSubstringIndex

Methods

public func readBytesSubstring(from: BytesView) -> String

ImplementsCharsIndex

Associated Types

type CharsYield = CharsView

Methods

public func readChars(from: CharsView) -> CharsView
public func readCharsChecked(from: CharsView) -> CharsView?

ImplementsCharsClampable

Associated Types

type CharsClampedYield = CharsView

Methods

public func readCharsClamped(from: CharsView) -> CharsView

ImplementsCharsWrappable

Associated Types

type CharsWrappedYield = CharsView

Methods

public func readCharsWrapped(from: CharsView) -> CharsView

ImplementsCharsSubstringIndex

Methods

public func readCharsSubstring(from: CharsView) -> String

ImplementsGraphemesIndex

Associated Types

type GraphemesYield = GraphemesView

Methods

public func readGraphemes(from: GraphemesView) -> GraphemesView
public func readGraphemesChecked(from: GraphemesView) -> GraphemesView?

ImplementsGraphemesClampable

Associated Types

type GraphemesClampedYield = GraphemesView

Methods

public func readGraphemesClamped(from: GraphemesView) -> GraphemesView

ImplementsGraphemesWrappable

Associated Types

type GraphemesWrappedYield = GraphemesView

Methods

public func readGraphemesWrapped(from: GraphemesView) -> GraphemesView

ImplementsGraphemesSubstringIndex

Methods

public func readGraphemesSubstring(from: GraphemesView) -> String

ImplementsLinesIndex

Associated Types

type LinesYield = LinesView

Methods

public func readLines(from: LinesView) -> LinesView
public func readLinesChecked(from: LinesView) -> LinesView?

ImplementsLinesClampable

Associated Types

type LinesClampedYield = LinesView

Methods

public func readLinesClamped(from: LinesView) -> LinesView

ImplementsLinesWrappable

Associated Types

type LinesWrappedYield = LinesView

Methods

public func readLinesWrapped(from: LinesView) -> LinesView

ImplementsLinesSubstringIndex

Methods

public func readLinesSubstring(from: LinesView) -> String

Defined in lang/std/core/range.ks