Zulip Chat Archive

Stream: lean4

Topic: Ensuring tail recursion


Siddhartha Gadgil (Aug 20 2021 at 08:36):

In scala, I can annote a method as @annotation.tailrec def ... so that it is a compiler error if the method cannot be tail call optimized. I was wondering if there is something like this in lean 4. I do know when a method is supposed to be tail recursive but judging by eye is a little fiddly.

Sebastian Ullrich (Aug 20 2021 at 08:38):

That would be nice, though we cannot guarantee mutual TCO yet anyway https://github.com/leanprover/lean4/pull/606#issue-704444706


Last updated: Dec 20 2023 at 11:08 UTC