locked: Lock variable binding

Description Usage Examples

Description

Using 'locked' (or its alias, 'immutable') together with 'typed' package implementation of assignment operator allows you to lock variable binding in simplier, more straighforward way (in one function call, without additional 'lockBinding' function calls).

Usage

1
2
3
locked(x) <- value

immutable(x) <- value

Examples

1
2
3
4
5
6
7
x <- 10
x <- 2.5
x
locked(q) <- 20
q <- 10
123 -> locked(y)
y <- 25

krzjoa/typed documentation built on Jan. 6, 2020, 12:46 a.m.