From 381ec5920d9ebeb335963778dec182268819e718 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 30 Mar 2022 14:05:57 -0400 Subject: Now demanding mandatory loop names, instead of using default "again" name. --- stdlib/source/documentation/lux.lux | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'stdlib/source/documentation/lux.lux') diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux index be907a73d..5dbef4fac 100644 --- a/stdlib/source/documentation/lux.lux +++ b/stdlib/source/documentation/lux.lux @@ -535,8 +535,8 @@ [(def: .public (range enum from to) (All (_ a) (-> (Enum a) a a (List a))) (let [(open "[0]") enum] - (loop [end to - output {.#End}] + (loop (again [end to + output {.#End}]) (cond (< end from) (again (pred end) {.#Item end output}) @@ -679,15 +679,14 @@ (documentation: /.loop (format "Allows arbitrary looping, using the 'again' form to re-start the loop." \n "Can be used in monadic code to create monadic loops.") - [(loop [count +0 - x init] + [(loop (again [count +0 + x init]) (if (< +10 count) (again (++ count) (f x)) x))] ["Loops can also be given custom names." - (loop my_loop - [count +0 - x init] + (loop (my_loop [count +0 + x init]) (if (< +10 count) (my_loop (++ count) (f x)) x))]) -- cgit v1.2.3