aboutsummaryrefslogtreecommitdiff
path: root/tour/variables.sloth
diff options
context:
space:
mode:
authorCody <cody@codyq.dev>2022-12-15 14:18:13 -0600
committerCody <cody@codyq.dev>2022-12-15 14:18:13 -0600
commit900bd3d64ac4c5c4c1511ab8388da3f2ed77849f (patch)
tree8de3006843d9dc717bf1c00d9942a068c90f413c /tour/variables.sloth
parentbddb011df4999f7ffeeddf6a4b66e2da6ab19ea0 (diff)
downloadsloth-900bd3d64ac4c5c4c1511ab8388da3f2ed77849f.tar.gz
Replace `let` keyword with `val` and `var`
Thanks for pointing out that using `let` and `let mut` was stupid for a scripting language @mworzala
Diffstat (limited to 'tour/variables.sloth')
-rw-r--r--tour/variables.sloth12
1 files changed, 6 insertions, 6 deletions
diff --git a/tour/variables.sloth b/tour/variables.sloth
index d105716..c3a9137 100644
--- a/tour/variables.sloth
+++ b/tour/variables.sloth
@@ -1,12 +1,12 @@
-# Variables can be declared using the `let` keyword, however they will be deeply
-# immutable. If you would like to make the variable mutable you can use `let mut`
+# Variables can be declared using the `var` keyword, however they will be mutable.
+# If you would like to make the variable immutable you can use `val`
#
# Variables can not be exported and can not be referrenced accross modules.
-let x = 0;
-let mut y = 0;
+var x = 0;
+val y = 0;
-x = 5; # Invalid
-y = 5; # Valid
+x = 5; # Valid
+y = 5; # Invalid
# Constants can be declared using the `const` keyword, unlike variables they can
# be exported and accessed across modules.