2 ms·
In Scala, as I recall, you could annotate a method as tail recursive so it wouldn't build if it weren't. A serious functional language pretty much has to have a
by emodendroket 5y ago
In Scala, as I recall, you could annotate a method as tail recursive so it wouldn't build if it weren't. A serious functional language pretty much has to have an answer for this since you're supposed to use recursion instead of iteration.
- yawaramin 5y agoScala has the '@tailrec' annotation for this, and OCaml has the '[@@tailcall]' attribute for the same reason.