Mirror of
forum.nim-lang.org
index
8979 :: Must abruptly exit from a recursive function on efficiency Need
[2022-03-05T02:55:52+01:00]
View Orginal
mardiyah
(orginal)
[2022-03-05T02:55:52+01:00]
view original
How to abruptly exit from a recursive procedure/function as the running process at a certain depth to go directly back to the invoking code line outside that recursive function ?
sky_khan
(orginal)
[2022-03-05T07:02:47+01:00]
view original
Not sure if you can. If you really need this, I think you'll have to rewrite it as non recursive probably by doing your own stack management yourself.
Araq
(orginal)
[2022-03-05T08:02:42+01:00]
view original
You can use exceptions for this.