|
|
|
|
|
by saityi
2331 days ago
|
|
You are correct, and I will fix it. The goal here was to encourage recursion and assuage fears of recursion coming from other languages: if I remember correctly, Standard ML does define semantics around 'expansive expressions' which make them /safer/ than I think most imperative programmers (my targeted audience) would expect, but this particular example would throw an exception. To fix it, I will rewrite this section to say that the standard requires optimising /tail-recursive/ calls away, and modify the example to be iteratively recursive, but I'd still like to assuage fears of recursion in the tour. The 'while' loop in SML is actually just a derived form, and is rewritten to recursion; there is no looping in the language. Do you have any suggestions for rewording? This is a work in progress that I was looking for feedback on :) Thank you! If you see anything else fishy, please let me know. |
|