Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: cd936ecf3e
Fetching contributors…

Cannot retrieve contributors at this time

49 lines (37 sloc) 0.865 kb
defcall table(h k default)
(or (table_get h k) default)
defset table((h k) v)
`(table_set ,h ,k ,v)
defcoerce table list
table_to_list
let $table table ; ignore later refinements
defcoerce nil table
$table
defcoerce list table
(fn(_)
(ret h ($table)
(each (k v) _
(= h.k v))))
def! table args
(as table pair.args)
def copy(x) :case table?.x
(as table (as list x))
def keys(h)
map car (as list h)
def vals(h)
map cadr (as list h)
def iso(x y) :case table?.x
(and table?.y
(iso len:keys.x len:keys.y)
(all (fn((k v))
(iso v y.k))
(as list x)))
def is-match(x y) :case table?.x
(and table?.y
(iso len:keys.x len:keys.y)
(all (fn((k v))
(is-match v y.k))
(as list x)))
mac w/table(h . body)
`(ret ,h (table)
,@body)
Jump to Line
Something went wrong with that request. Please try again.