Data update

This commit is contained in:
Ingy döt Net 2025-08-11 18:05:26 -07:00
parent 4d5544505c
commit 4924dd0264
3073 changed files with 55820 additions and 4408 deletions

View file

@ -0,0 +1,20 @@
(if (> (+ 5 4) 7)
# then
(print "5+4 > 7")
# else
(print "something has gone terribly wrong"))
(if (not true)
{
# this is a serie of expressions inside the 'then' block of the conditional
(print "true is... not true?")
(foo bar 5)
(+ 5 4) }
{
# the 'else' block can also have multiple expressions in it
(print "something")
(print "is weird") })
# conditions can be used as expressions too
(let n (if (> 5 6) "error" "5 < 6"))
(print n)

View file

@ -0,0 +1 @@
CASE WHEN cond THEN x ELSE y END;

View file

@ -0,0 +1 @@
CASE value [WHEN x THEN y]+ ELSE z END;

View file

@ -0,0 +1 @@
SELECT CASE x WHEN (x IS NULL) THEN 'null' ELSE 'nonnull' END FROM (SELECT null as x);

View file

@ -0,0 +1,29 @@
local val = 1
if val > 2 then
print("a")
elseif val == 2 then
print("b")
else
print("c")
end
val = 123
switch val do
case 1: print(1); break
case 2: print(2); break
default: print(123)
end
-- Hash-based conditionals
local t = {
["one"] = function() print("one") end,
["two"] = function() print("two") end
}
-- (default)
setmetatable(t, {
__index = function(_) print("default") return function() end end
})
t["one"]()
t["two"]()
t["100000"]()

View file

@ -0,0 +1,4 @@
? i < 0
i =: 0
|
i =: 42

View file

@ -0,0 +1,5 @@
\C
if i < 0
i = 0
else
i = 42

View file

@ -0,0 +1 @@
i =: ?( i<0 ?! 0 ?: 42 ?)