Somehow you'd have to understand if the tail recursion in that situation is beneficial or not.
https://www.erlang.org/doc/efficiency_guide/myths.html#myth--tail-recursive-functions-are-much-faster-----than-recursive-functions Best, Kevin On Wed, 15 Jun 2022 at 16:18, Adam Lancaster <a...@a-corp.co.uk> wrote: > Do you have an example of a function that caused the stack to blow up? > > Best > Adam > > On Wed, 15 Jun 2022 at 23:08, 'vmrc' via elixir-lang-core < > elixir-lang-core@googlegroups.com> wrote: > >> Scala has a handy @tailrec annotation >> <https://www.scala-lang.org/api/2.12.1/scala/annotation/tailrec.html> >> that makes the compiler error out if the function is not amenable to tail >> call optimization. One possible footgun while learning Elixir and recursion >> is trying to implement a tail-recursive fn and realizing when the stack >> blows up that you haven't in fact succeeded. This annotation would serve >> as a safeguard. >> >> *O conteúdo desta mensagem é confidencial e destinado exclusivamente aos >> destinatários. Caso a receba por engano, favor destruí-la e notificar o >> remetente de imediato. O correio eletrônico não configura meio seguro para >> transmissão de dados e o remetente NÃO se responsabiliza por eventual erro, >> atraso, extravio, interceptação ou infecção por vírus. Cabe ao destinatário >> solicitar versão física sempre que necessário.* >> >> *The content of this message is confidential and was intended solely to >> its recipient. **In case this message is received by mistake, please >> destroy it and notify the sender immediately. Electronic mails are not a >> safe channel for data transmission and the sender accepts NO liability for >> eventual errors, delays, loss, interception or virus infection. When >> necessary, the receiver must request a hard-copy version.* >> >> -- >> You received this message because you are subscribed to the Google Groups >> "elixir-lang-core" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to elixir-lang-core+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/elixir-lang-core/f02e06bf-a9ab-482b-b5de-1b11a8cdb9d8n%40googlegroups.com >> <https://groups.google.com/d/msgid/elixir-lang-core/f02e06bf-a9ab-482b-b5de-1b11a8cdb9d8n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "elixir-lang-core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to elixir-lang-core+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elixir-lang-core/CADwgC_ANV_qJCrdykhJm83%3D316z56uytNJy05MYh1591fG5AuQ%40mail.gmail.com > <https://groups.google.com/d/msgid/elixir-lang-core/CADwgC_ANV_qJCrdykhJm83%3D316z56uytNJy05MYh1591fG5AuQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAJPONbGm%3DEvTOs-ebe%3DqO%2BLh4veXRvzVGMT9jOE7e7ejzBdcYw%40mail.gmail.com.