From 900bd3d64ac4c5c4c1511ab8388da3f2ed77849f Mon Sep 17 00:00:00 2001 From: Cody Date: Thu, 15 Dec 2022 14:18:13 -0600 Subject: Replace `let` keyword with `val` and `var` Thanks for pointing out that using `let` and `let mut` was stupid for a scripting language @mworzala --- tour/variables.sloth | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tour/variables.sloth') 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. -- cgit v1.2.3