diff options
| author | Cody <cody@codyq.dev> | 2022-12-15 14:18:13 -0600 |
|---|---|---|
| committer | Cody <cody@codyq.dev> | 2022-12-15 14:18:13 -0600 |
| commit | 900bd3d64ac4c5c4c1511ab8388da3f2ed77849f (patch) | |
| tree | 8de3006843d9dc717bf1c00d9942a068c90f413c /tour/types.sloth | |
| parent | bddb011df4999f7ffeeddf6a4b66e2da6ab19ea0 (diff) | |
| download | sloth-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/types.sloth')
| -rw-r--r-- | tour/types.sloth | 12 |
1 files changed, 6 insertions, 6 deletions
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<String, i32>, }; -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)), |
