Re: Try/Catch

new topic     » goto parent     » topic index » view thread      » older message » newer message
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:

  1. No obvious implementation at the compiler level
  2. What happens with a procedure?
  3. try/catch provides a block of code, rather than a return value
  4. Need to invent error code values for each function (clunky when dealing with indexing)
  5. Have to add if/then after every call
  6. Unlike try/catch will not "bubble up" to appropriate level

- David

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu