equals: Immutequality Operator

Description Arguments Examples

Description

Assign value to the symbol x, which can then subsequently be treated equal to value. This "immutability" is emulated by assigning an active binding to the symbol x. If the value is accessed, it is simply returned by the active binding, but if a value change is attempted, an error is raised that the symbol cannot be reused. The immutequality operator can thus be used to promise that the value associated with a symbol will not change for the remainder of its scope.

Arguments

x

a symbol

value

the associated value

Examples

1
2
3
4
x = 10

print(x)
tryCatch(x <- x*2, error = function(e) message(e))

smbache/immutequality documentation built on May 30, 2019, 5:01 a.m.