(def memo (f) (with (cache (table) nilcache (table)) (fn args (or (cache args) (and (no (nilcache args)) (aif (apply f args) (= (cache args) it) (do (assert (nilcache args)) nil)))))))