Here is an example I used to teach writing loops as tail-recursive
functions:
http://ats-lang.sourceforge.net/COMPILED/doc/PROJECT/SMALL/JSmydraw/Sierpinski_3angle_txt.html
Here is the source code for this example:
I put it here so that the example could be easily found by searching the
phrase ‘poor man’.
Cheers!