Arc Forumnew | comments | leaders | submitlogin
1 point by ehird 4272 days ago | link | parent

Ridiculous:

    (def ablast (l)
      (if (no (cdr l))
          nil
          (cons (car l) (ablast (cdr l)))))

    (def replc (x y l)
      (if (atom l) (if (is x l) y l)
          (no l) nil
          (is x (car l)) (cons y (replc x y (cdr l)))
          (acons (car l)) (cons (replc x y (car l)) (replc x y (cdr l)))
          (cons (car l) (replc x y (cdr l)))))

    (mac imp body
      (if (no body) nil
          (replc 'it `(imp ,@(ablast body)) (last body))))