RangeUpTo

public struct RangeUpTo[T] where T: Comparable { /* private fields */ }

Partial range (-∞, end) — produced by the prefix ..< operator.

Not Iterable — there is no start to iterate from.

Examples

(..<10).contains(5) // true (..<10).contains(10) // false

Representation

Single value: end. No heap allocation.

Properties

public var end: T

Upper bound — excluded from the range.

Initializers

public init(T)

Methods

public func contains(T) -> Bool

Returns true iff value < end.

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: RangeUpTo[T]) -> Bool

Structural equality.

public func notEqual(to: Self) -> Bool

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

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