-
-
Notifications
You must be signed in to change notification settings - Fork 4
mutability
pannous edited this page Apr 24, 2024
·
2 revisions
mutating modifying member functions are to be suffixed with an exclamation point (by the linter?)
class string{
data chars
void upper!{
chars[0]=chars[0].upper()
}
variables can be force mutated by adding an exclamation point
x="test"
x.upper!
# same as x = x.upper()