Hash :
027210f5
Author :
Thomas de Grivel
Date :
2024-03-29T11:45:04
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
def fib = fn (x) { if x < 0 0 else fib(x - 2) + fib(x - 1) end }
def fib = fn (x) { if x < 0 then 0 else fib(x - 2) + fib(x - 1) end }
def fib = fn { (0) { 1 } (1) { 1 } (x) { if x < 0 then 0 else fib(x - 2) + fib(x - 1) end }}
do end
end
do end
end
do end
defmodule Plop do end
quote Plop
quote_cfn Plop
(Sym) "Abc"
defmodule Plop do end
defmodule Plop do def a = 1 end
quote_cfn Plop
defmodule Plop do def a = 1 end
Plop.a
defmodule Plop do def a = 1 end
Plop.a
Plop
defmodule Plop do def a = 1 end
Plop.a
defmodule Plop do def a = 1 end
Plop.a
defmodule Plop do defoperator :operator_add :+ cfn Tag "tag_add" (Tag, Tag, Result) 10 :left end
defmodule Plop do defoperator :operator_add :+ cfn Tag "tag_mul" (Tag, Tag, Result) 10 :left end
defmodule Plop do
defoperator :operator_add :+ cfn Tag "tag_mul" (Tag, Tag, Result) 10 :left
def sq = fn (x) { x + x }
end
Plop.sq(4)
defmodule Plop do defoperator :operator_add :+ cfn Tag "tag_mul" (Tag, Tag, Result) 10 :left end
defmodule Plop do
def sq = fn (x) { x + x }
end
Plop.sq(4)
defmodule Plop do def a = 1 end
Plop.a
(Sw) 123\
(Sw) 123
(Sw) 123/2
(Sw) 123 / 2
defmodule Plop do def a = 1 end
Plop.a
defmodule Plop do def a = 2 end
Plop.a
defmodule Plop do def a = 1; def double = fn (x) { x * 2 } end
Plop.a
Plop.double
Plop.double(21)
def a = 1
a
def double = fn (x) { x * 2 }
double(42)
defmodule Tiyon do
def a = 1
def double = fn (x) { x * 2 }
def double_tuple = macro (x) do {x, x} end
def double_list = macro (x) do [x, x] end
end
Tiyon.a
Tiyon.double(21)
Tiyon.double_tuple(21)
Tiyon.double_tuple(21 + 21)
Tiyon.double_list(21 + 21)
[42, x] = Tiyon.double_list(21 + 21)
[42, x] = [42, 42]
x
Tiyon.double_list(21 + 21) = [42, y]
def last = fn (x) do
[y | _] = List.reverse(x)
y
end
def last = fn (x) do
[y | _] = List.reverse(x)
y
end
def List.last = fn (x) do
[y | _] = List.reverse(x)
y
end
List.last([1, 2, 3, 4])
def List.last = fn (x) do
[y | z] = List.reverse(x)
y
end
List.last([1, 2, 3, 4])
[x, y | z] = List.reverse([1, 2, 3])
x
y
z
[x, y | z] = List.reverse([1, 2, 3, 4])
x
y
z
if true then true end
if 42 then true end
if 0 then true end
if 0 then true else false end