Skip to content

Instantly share code, notes, and snippets.

View jkthorne's full-sized avatar
💭
caffeinated

Jack jkthorne

💭
caffeinated
View GitHub Profile
record Cell, car, cdr
alias List = Nil | (-> Cell)
def inf(x = 0)
inf :: -> Cell
inf = -> { Cell.new(x, inf) }
end
def nat(x = 0)
@datanoise
datanoise / crystal-tags.cr
Last active March 5, 2021 03:24
ctags for crystal language
require "compiler/crystal/**"
require "option_parser"
include Crystal
class ToCtagsVisitor < Visitor
@filename : String
@lines : Array(String)
@io : IO
@opts : Generator
@rf-
rf- / 00-README.md
Last active March 8, 2019 06:39 — forked from datanoise/crystal-tags.cr
Crystal ctags generator

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)))