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
fn (x) { x }
fn (x, _y) { x }
fn ([x | _y]) { x }
fn {
([]) { :error }
([x | _y]) { x }
(_) { :error }
}
fn (x) do
"Hello, world !"
x * 2
end
fn (x) { x }
1
fn (x, _y) { x }
1
fn ([x | _y]) { x }
1
fn {
([]) { :error }
([x | _y]) { x }
(_) { :error2 }
}
1
fn (x) do
"Hello, world !"
x * 2
end
4
do
f = fn (x) do
puts("Hello, world !")
x * 2
end
f(2)
end
Hello, world !
4