Re: Try/Catch
- Posted by Shian_Lee Jan 11, 2015
- 5485 views
Continue...
Raw example for 'Specifications':
Routine foo() returns an integer, so, using Specifications to avoid exceptions can look like this:
function foo(sequence s) with spec -999
return length(s[1..$ - 5]) > 2
end function
i = foo(s) -- in case of exception in foo -999 is returned.
(very raw but just for example)
Design by Contract is just a start point - Euphoria developers are clever enough to continue.