top | item 46160766

(no title)

jhgb | 2 months ago

It gives you arbitrarily complex control flow even in presence of modularity. A tail call is a state transition. Without them, you'd have to resort to a big loop (which breaks modularity), or some sort of trampoline (which works but it's a bit clumsy).

discuss

order

artemonster|2 months ago

this whole thing is equivalent to a goto at the beginning of a function.

dragonwriter|2 months ago

This is true in the same sense that function calls are equivalent to gotos at the beginning and end of the function.

jhgb|2 months ago

Yes, except without all the known disadvantages of goto. That's the whole point.