Re:How Tail Call Optimization Works
by Geminidog on Friday January 08, 2021 @12:40PM
(#25687327)
Look at my example. if you literally communicated with someone that way would the other person be confused? The answer is yes.
[ Parent
| on HN ]
You're not comparing like with like - you're comparing a repeat function (or keyword) with the implementation of a repeat function. The imperative equivalent would be something like "make an int called i, then repeatedly add one to i, checking whether i is less than five, and each time you do that do the special task", which is by no means clearer. And if anything writing a "repeat" function is easier in the functional world than the imperative one, since traditional imperative languages don't have first-class functions.