Binding
public final class Binding<Element: Equatable>
The most basic unifiable type. Stores an Element such that,
on unification, both Bindings refer to this same Element.
Note that this element may be set to nil to indicate that no
value has been determined.
-
Constructs a new unbound
Glue.Declaration
Swift
public convenience init(value: Element? = nil) -
The
valuestored by thisBinding, otherwisenilif it is not yet determined.Declaration
Swift
public var value: Element?
-
Associates the
bindingwith thenewValueif possible, throwing aUnificationErrorif thebindingis already associated with a different value.Declaration
Swift
public static func resolve(binding: Binding, withValue newValue: Element) throws
-
If
bindinghas no value set, its value is set tonewValue. Otherwise, the currentvalueis unified withnewValue.Declaration
Swift
public static func resolve(binding: Binding, withValue newValue: Element) throws
-
A textual representation of the value or the binding if no value exists.
Declaration
Swift
public var description: String
-
Undocumented
Declaration
Swift
public final class Binding<Element: Equatable>
-
Unifies
lhswithrhs, otherwise throws aUnificationError.Declaration
Swift
public static func unify(lhs: Binding, _ rhs: Binding) throws -
Performs
actionas an operation onselfsuch that theselfpreserves its initialgluevalue if the operation fails.Declaration
Swift
public static func attempt(value: Binding, _ action: () throws -> ()) throws
-
Copies
thisreusing any substructure that has already been copied within this context, and storing any newly generated substructure into the context.Declaration
Swift
public static func copy(this: Binding, withContext context: CopyContext) -> Binding
View on GitHub
Binding Class Reference