MarcoArray

public protocol MarcoArray : MarcoValue

Marco array value.

  • Element count.

    Declaration

    Swift

    var count: Int { get }
  • Returns an element on an index position.

    Declaration

    Swift

    subscript(index: Int) -> MarcoValue { get set }
  • Inserts an element on an index position.

    Declaration

    Swift

    func insert(_ value: MarcoValue, at index: Int)
  • Removes an element on an index position.

    Declaration

    Swift

    func remove(at index: Int)
  • isEmpty Extension method

    True if the array is empty.

    Declaration

    Swift

    public var isEmpty: Bool { get }
  • isNotEmpty Extension method

    True if the array is not empty.

    Declaration

    Swift

    public var isNotEmpty: Bool { get }
  • add(_:) Extension method

    Appends an element to the array.

    Declaration

    Swift

    public func add(_ value: MarcoValue)
  • elements Extension method

    Returns all elements. The new array instance will be created.

    Declaration

    Swift

    public var elements: [MarcoValue] { get }
  • forEach(_:) Extension method

    Iterates over all elements.

    Declaration

    Swift

    public func forEach(_ body: (MarcoValue) throws -> ()) rethrows
  • all(predicate:) Extension method

    Returns true if predicate returns true for all elements.

    Declaration

    Swift

    public func all(predicate: (MarcoValue) throws -> Bool) rethrows -> Bool
  • none(predicate:) Extension method

    Returns true if predicate returns false for all elements.

    Declaration

    Swift

    public func none(predicate: (MarcoValue) throws -> Bool) rethrows -> Bool
  • any(predicate:) Extension method

    Returns true if predicate returns true at least for one element.

    Declaration

    Swift

    public func any(predicate: (MarcoValue) throws -> Bool) rethrows -> Bool
  • first(where:) Extension method

    Returns the first value for which predicate returns true.

    Declaration

    Swift

    public func first(where predicate: (MarcoValue) throws -> Bool) rethrows -> MarcoValue?
  • firstIndex(where:) Extension method

    Returns the first value for which predicate returns true.

    Declaration

    Swift

    public func firstIndex(where predicate: (MarcoValue) throws -> Bool) rethrows -> Int?
  • remove(_:) Extension method

    Removes an element with a specified value.

    Declaration

    Swift

    public func remove(_ value: MarcoValue) -> Bool
  • sequence() Extension method

    Returns a Sequence representation of the array.

    Declaration

    Swift

    public func sequence() -> MarcoArraySequence
  • accept(_:data:) Extension method

    Declaration

    Swift

    public func accept<V, D, R>(_ visitor: V, data: D) -> R where V : MarcoVisitor, D == V.Data, R == V.ReturnType