Data update

This commit is contained in:
Ingy dot Net 2024-04-19 16:56:29 -07:00
parent 0df55f9f24
commit aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions

View file

@ -2,6 +2,7 @@
{{omit from|Euphoria}}
{{omit from|M4}}
{{omit from|Retro}}
[[Category:Flow control]]
This task is to give an example of an exception handling routine
and to "throw" a new exception.

View file

@ -4,6 +4,6 @@ T SillyError
.message = message
X.try
X SillyError(egg)
X.throw SillyError(egg)
X.catch SillyError se
print(se.message)

View file

@ -1,8 +1,7 @@
# do something
throw "not a math exception"
catch .e {
if .e["cat"] == "math" {
catch[.e] {
if .e'cat == "math" {
# change result...
} else {
# rethrow the exception
@ -10,5 +9,4 @@ catch .e {
}
} else {
# no exception
...
}

View file

@ -1,10 +1,11 @@
100 / 0
catch {
if _err["cat"] == "math" {
if _err'cat == "math" {
# change result
123
} else {
# rethrow the exception
throw
}
}

View file

@ -1,3 +1,3 @@
val .safediv = f { .x / .y ; catch { 0 } }
val .safediv = fn(.x, .y) { .x / .y ; catch : 0 }
.safediv(7, 7) # 1
.safediv(7, 0) # 0