Hash :
2d3391c4
Author :
Thomas de Grivel
Date :
2024-10-08T20:47:56
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
hd(Str.split((Str) HTTP.mime_type(File.ext("Plop.html")), "/"))
List.first(Str.split((Str) HTTP.mime_type(File.ext("Plop.html")), "/"))
first(Str.split((Str) HTTP.mime_type(File.ext("Plop.html")), "/"))
(Sym) first(Str.split((Str) HTTP.mime_type(File.ext("Plop.html")), "/"))
SH.run("file -b ${SH.escape(path)}")
size = 10
if (size > 1024 * 1024 * 1024 * 1024) do
if (size > 1024 * 1024 * 1024 * 1024) do
s = size * 10 / 1024 / 1024 / 1024 / 1024
"#{s / 10}.#{s % 10}Tb"
size = 100
if (size > 1024) do
s = size * 10 / 1024
"#{s / 10}.#{s % 10}Kb"
quote %
10 % 3
human_size(1024)
human_size(1025)
human_size(1024)
human_size(2024024)
human_size(100)
Str.size("abc")
human_size(0)
human_size((Uw) 114)
type(1024 * 1024 * 1024 * 1024)
human_size((Uw) 114)
system(["ls", "-l"])
puts(system(["ls", "-l"]))
puts(system(["ls", "-l"])
)
1 +
2
1 + 2
1 + 100000000000000000000000000000000000000000000
1 + 100000000000000000000000000000000000000000000.
1 + 10000000000000000000000000000000000000000000.
1 + 10000000000000000000000000000000000000000000
1 + 10000000000000.0
1 + 10000000000000/2
1 + 10000000000000/3
1 + 2/3
3 **** 4
def op = %KC3.Operator{sym: :****, symbol_value: fn (a, b) { a * b * 4 }}
3 **** 4
3 * 4 * 4
Sh.escape("abc")
Sh.escape("abc;")
puts(Sh.escape("abc;"))
puts(Sh.escape("abc"))
puts(Sh.escape("ab c"))
puts(Sh.escape("ab(c"))
puts(Sh.escape("abc"))
1 + 1
1 + 10000000000000000000000000000000000000000000000000
2 * 10000000000000000000000000000000000000000000000000
type(10000000000000000000000000000000000000000000000000)
type(1)
type(255)
type(256)
quote fn (x) { x * x }
quote if true do if false do 1 else fn (x) { x * x } end end
quote if true do if false do 1 else fn (x) do x * x end end end
quote if true do if false do %KC3.Operator{sym: :-, symbol_value: 3} else fn (x) do x * x end end end
if true do if true do %KC3.Operator{sym: :-, symbol_value: 3} else fn (x) do x * x end end end
type(0)
type(-1)
def operator_muul = %KC3.Operator{sym: :****, symbol_value: fn (a, b) { a * a + b * b }
}
3 **** 5
3 * 3 + 5 * 5
system(["ls", "-l"])
tem(["ls", "-l"])
human_size(2024024)
to_lisp
to_lisp(quote 1 + 1)
to_lisp(quote 1 + 1 * 2 / 3 - 4)
to_lisp(quote a = ?; a <- 1; a)
Facts.database()
a = Facts.database()
(Facts) a
a = Facts.env_db()
(Facts) a
db = ^ a
(Facts) db
Facts.with(db, [[KC3, :operator, op = ?], [op, :sym, sym = ?]], fn (fact) { puts("#{op} #{sym}") })
op
sym
Facts.with(db, [[KC3, :operator, op = ?], [op, :sym, sym = ?]], fn (fact) { puts("#{op} #{sym}") })
Facts.with(Facts.env_db(), [[KC3, :operator, op = ?], [op, :sym, sym = ?]], fn (fact) { puts("#{op} #{sym}") })
Facts.with(Facts.env_db(), [[KC3, :operator, op = ?], [op, :sym, sym = ?]], fn (fact) { puts("#{inspect(op)} #{inspect(sym)}") })
[[KC3, :operator, op = ?], [op, :sym, sym = ?]]
%HTTP.Request{}
quote %HTTP.Request{}
quote %HTTP.Request{url: "/plop"}
quote %HTTP.Request{method: GET, url: "/plop"}
quote %HTTP.Request{method: GET, url: "/plop", body: void}
quote [a: 1, b: 2]
[a: 1, b: 2]
AList.to_map([a: 1, b: 2])