Arc Forumnew | comments | leaders | submitlogin
4 points by pg 5701 days ago | link | parent

Good idea; fixed:

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