Arc Forumnew | comments | leaders | submitlogin
1 point by Jesin 5832 days ago | link | parent

By the way, I think I said elsewhere that I've been rewriting arc.arc and cleaning it up a little. I have been paying attention to the comments, so if anything is a little messy but runs 3x as fast as the clean way, I'm leaving it as is.

Anyway, one of the comments is that, while iso takes 2 args now, it really should take n args. Here's what I came up with:

  (let iso1 nil
    (def iso1 (x y)
      (or (is x y)
          (and (acons x)
               (acons y)
               (iso1 (car x) (car y))
               (iso1 (cdr x) (cdr y)))))
    (def iso (x . xs)
      (if xs
          (and (iso1 x (car xs))
               (apply iso xs))
          t)))
I also came up with this function, a macex that expands more than just the car:

  (def macex-all (e)
    (zap macex e)
    (if acons.e
        (map1 macex-all e)
        e))