Re: Try/Catch
- Posted by dcuny Jan 11, 2015
- 5388 views
Shian_Lee said...
function foo(sequence s) with spec -999
return length(s[1..$ - 5]) > 2
end function
So you still have to catch it at the function level.
This seems to me less compelling than try/catch:
- No obvious implementation at the compiler level
- What happens with a procedure?
- try/catch provides a block of code, rather than a return value
- Need to invent error code values for each function (clunky when dealing with indexing)
- Have to add if/then after every call
- Unlike try/catch will not "bubble up" to appropriate level
- David