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/types.sloth | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tour/types.sloth') diff --git a/tour/types.sloth b/tour/types.sloth index a47fd3a..c7ef2f5 100644 --- a/tour/types.sloth +++ b/tour/types.sloth @@ -6,7 +6,7 @@ type Person = { grades: Map, }; -let cody = Person { +val cody = Person { name: "Cody Q", age: 17, hobbies: { @@ -59,12 +59,12 @@ impl Color { (value * 255) as u8 } - let h = (hue * 6).floor() as i32; + val h = (hue * 6).floor() as i32; - let f = hue * 6 - h; - let p = value * (1 - saturation); - let q = value * (1 - f * saturation); - let t = value * (1 - (1 - f) * saturation); + val f = hue * 6 - h; + val p = value * (1 - saturation); + val q = value * (1 - f * saturation); + val t = value * (1 - (1 - f) * saturation); return match h { 0 => Color(c(value), c(t), c(p)), -- cgit v1.2.3