Follow

@uvok If it's just three of those, sure.

Otherwise (if the language supports that) I'd store the pointers/references to fun1 ... funn in an array and iteratare over that (fun_ptr holding the current pointer), with the if(fun_ptr()) block doing the cleanup and break out of the loop if true.

But it really depends on circumstances and language.

And besides, "break" is an implicit goto. Or anything else ending a loop. Or branches in general.

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!