From 9e2f1e76f2c8df01ed7687d934c3210fcf676bd6 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 16 Jun 2022 00:48:19 -0400 Subject: De-sigil-ification: suffix : [Part 13] --- documentation/book/the_lux_programming_language/chapter_5.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'documentation/book/the_lux_programming_language/chapter_5.md') diff --git a/documentation/book/the_lux_programming_language/chapter_5.md b/documentation/book/the_lux_programming_language/chapter_5.md index a7d09016a..fe36dc46d 100644 --- a/documentation/book/the_lux_programming_language/chapter_5.md +++ b/documentation/book/the_lux_programming_language/chapter_5.md @@ -100,7 +100,7 @@ We can see its power by looking at some examples. For instance, the `factorial'` function you saw in the previous chapter could have been written like this: ```clojure -(def: (factorial' acc n) +(def (factorial' acc n) (-> Nat Nat Nat) (case n 0 acc @@ -121,7 +121,7 @@ The _"default"_ branch works because we're binding the value of `n` onto a varia However, since it is binding a variable, that means we could have used `_` instead of `n` during our calculations; like this: ```clojure -(def: (factorial' acc n) +(def (factorial' acc n) (-> Nat Nat Nat) (case n 0 acc @@ -221,7 +221,7 @@ Recursion is nothing more than the capacity for a function to call itself (often It's not hard to see how this mechanism can be used to loop in any way you want, and we've already seen examples of recursion in action. ```clojure -(def: (factorial' acc n) +(def (factorial' acc n) (-> Nat Nat Nat) (if (n.= 0 n) acc @@ -241,7 +241,7 @@ Our example `factorial'` function has its recursive call in the _tail position_ This alternative doesn't: ```clojure -(def: (factorial' acc n) +(def (factorial' acc n) (-> Nat Nat Nat) (if (n.= 0 n) acc @@ -269,7 +269,7 @@ Lux also offers a macro that gives you a slightly similar experience to those ki To see it in action, let's rewrite (once more!) our `factorial` function: ```clojure -(def: (factorial n) +(def (factorial n) (-> Nat Nat) (loop [acc 1 n n] @@ -346,7 +346,7 @@ Well, we haven't really seen that in action yet. It's time to put that theory into practice... with an example: ```clojure -(def: (iterate_list f list) +(def (iterate_list f list) (All (_ a b) (-> (-> a b) (List a) (List b))) (case list {.#End} -- cgit v1.2.3