Anonymous user
Exceptions: Difference between revisions
Added Dyalect
Puppydrum64 (talk | contribs) |
(Added Dyalect) |
||
Line 854:
end;
end;</lang>
=={{header|Dyalect}}==
<lang dyalect>func Integer.Add(x) {
throw Error.NegativesNotAllowed(x) when x < 0
this + x
}
try {
12.Add(-5)
} catch {
NegativesNotAllowed(x) => print("Negative number: \(x)")
}</lang>
=={{header|DWScript}}==
|