ID:165715
 
I'm working on a new library where some procs are likely to indirectly call each other right before they return. Is this tail recursion optimized in DM?

Alternatively, I could set waitfor to 0, assign a value to ., and then make my last proc call. It looks like that's the sort of thing that waitfor was made for.

I just don't want to resort to using an undocumented feature if BYOND handles the situation fine without it.
ACWraith wrote:
I'm working on a new library where some procs are likely to indirectly call each other right before they return. Is this tail recursion optimized in DM?

DM automatically optimizes nothing.

Alternatively, I could set waitfor to 0, assign a value to ., and then make my last proc call. It looks like that's the sort of thing that waitfor was made for.

Possibly, but usually spawn() works best. The waitfor example can easily be rewritten with spawn().

Lummox JR