https://github.com/smbache/immutequality
Use Equality Assignment for Immutability in R
https://github.com/smbache/immutequality
Last synced: 4 months ago
JSON representation
Use Equality Assignment for Immutability in R
- Host: GitHub
- URL: https://github.com/smbache/immutequality
- Owner: smbache
- License: other
- Created: 2015-06-30T12:48:54.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-30T13:43:52.000Z (almost 10 years ago)
- Last Synced: 2024-08-13T07:15:16.985Z (8 months ago)
- Language: R
- Size: 113 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - smbache/immutequality - Use Equality Assignment for Immutability in R (R)
README
# Immutequality: Emulate Immutability With Equality Operator
This is a small "though experiment" to make `R` emulate the
difference between `=` ("is"), and `<-` ("becomes") as
distinguished e.g. in `F#`. In other words `=` makes a
"promise" that `x = 10` means that `x` won't change for
the remainder of the defining scope.## Example
```{r}library(immutequality)
## or, more silently and explicitely:
# import::from(immutequality, "=")x = 10
print(x)
# Will raise an error!
x <- x*2# This also
assign("x", 20)# .. and this too
x = 20
```