Is there a way I can exit proc or function in mozart oz

83 Views Asked by At

I am trying to do a recursion proc in mozart oz, is there a way I can exit the proc or function when I get my answer so that the rest recursion will not continue.

1

There are 1 best solutions below

1
On

You could use an exception for that.

But usually, the recursive call is at the end of a function anyway. Just returning will automatically go up the stack.