~sircmpwn/harelang.org

b070f6facec8015ab15c2596f956753c3db12081 — Lorenz (xha) 2 months ago 468a4ca
language introduction: fix for-each description

i misunderstood bryon's feedback, this should be better.

Signed-off-by: Lorenz (xha) <me@xha.li>
1 files changed, 6 insertions(+), 6 deletions(-)

M content/tutorials/introduction.md
M content/tutorials/introduction.md => content/tutorials/introduction.md +6 -6
@@ 1238,12 1238,12 @@ sections:
      copies beacuse the values are too big. The example prints the pointer to
      the element and then the element itself.

      The initializer of the binding is a special "iterator" function whose
      return type is a tagged union which includes the `done` type. This
      function is called each iteration and it's return value, is checked. If
      the value's type is `done`, the loop is terminated. Otherwise, the value
      is assigned, and its type is that of the return type minus `done`. In this
      case, that would be `str`.
      In the third for-each loop, the initializer of the binding is a special
      "iterator" function whose return type is a tagged union which includes the
      `done` type. This function is called each iteration and it's return value,
      is checked. If the value's type is `done`, the loop is terminated.
      Otherwise, the value is assigned, and its type is that of the return type
      minus `done`. In this case, that would be `str`.

      A lot of standard libary functions make use of the `done` type or aliases
      of it. You can use a for-each iterator loop in these cases, or create some