Hash :
7ec48a02
Author :
Thomas de Grivel
Date :
2024-08-10T19:11:54
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
quote fn (x) { x }
quote fn (x, _y) { x }
quote fn ([x | _y]) { x }
quote fn {
([]) { :error }
([x | _y]) { x }
(_) { :error }
}
quote fn (x) do
"Hello, world !"
x * 2
end
a = fn (x) { x }
a(1)
b = fn (x, _y) { x }
b(1, 2)
c = fn ([x | _y]) { x }
c([1, 2])
d = fn {
([]) { :error }
([x | _y]) { x }
(_) { :error2 }
}
d([1, 2])
e = fn (x) do
"Hello, world !"
x * 2
end
e(2)
quote do
f = fn (x) do
puts("Hello, world !")
x * 2
end
f(2)
end
do
f = fn (x) do
puts("Hello, world !")
x * 2
end
f(2)
end