To compile with Homebrew-installed LLVM:
PATH=/usr/local/opt/llvm/bin:$PATH crystal build crystal-tags.cr
record Cell, car, cdr | |
alias List = Nil | (-> Cell) | |
def inf(x = 0) | |
inf :: -> Cell | |
inf = -> { Cell.new(x, inf) } | |
end | |
def nat(x = 0) |
To compile with Homebrew-installed LLVM:
PATH=/usr/local/opt/llvm/bin:$PATH crystal build crystal-tags.cr
cons = lambda { |a, b| | |
lambda { |m| m.call(a, b) } | |
} | |
car = lambda { |m| m.call(lambda { |a, _| a }) } | |
cdr = lambda { |m| m.call(lambda { |_, b| b }) } | |
# A list that only uses lambdas | |
list = cons.call(1, cons.call(2, cons.call(3, nil))) |