From 39bb6cb78c80607cab897e2cf196180904d50074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Nuno=20Monteiro?= Date: Sun, 19 Mar 2017 19:00:37 -0700 Subject: [PATCH] Add basic docs for `while` (#1151) --- docs/index.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/index.html b/docs/index.html index 445b7e995..1431b9e9f 100755 --- a/docs/index.html +++ b/docs/index.html @@ -849,6 +849,25 @@ #### While Loops +While loops are also fully imperative constructs. They execute a code block while +some condition is true. The form of a `while` loop includes a single expression, +the condition to test. + +```reason +while testCondition { + statements; +}; +``` + +The parenthesis around `testCondition` may be omitted if they are unnecessary, +such as in the following example. + +```reason +while true { + print_newline (); +}; +``` + Type Parameters ---------- Some types are very specific, such as `int`, or `string`, but other types