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
value
stored by thisBinding
, otherwisenil
if it is not yet determined.Declaration
Swift
public var value: Element?
-
Associates the
binding
with thenewValue
if possible, throwing aUnificationError
if thebinding
is already associated with a different value.Declaration
Swift
public static func resolve(binding: Binding, withValue newValue: Element) throws
-
If
binding
has no value set, its value is set tonewValue
. Otherwise, the currentvalue
is 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
lhs
withrhs
, otherwise throws aUnificationError
.Declaration
Swift
public static func unify(lhs: Binding, _ rhs: Binding) throws
-
Performs
action
as an operation onself
such that theself
preserves its initialglue
value if the operation fails.Declaration
Swift
public static func attempt(value: Binding, _ action: () throws -> ()) throws
-
Copies
this
reusing 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