Arc Forumnew | comments | leaders | submitlogin
Simplified w/bars
4 points by CatDancer 6418 days ago | 1 comment

  ; released to the public domain

  ; (macmap list tostring x y z)
  ; --> (list (tostring x) (tostring y) (tostring z))
  
  (mac macmap (combiner oneach . body)
    `(,combiner ,@(map (fn (e) `(,oneach ,e)) body)))
  
  (mac w/bars body
    `(apply pr
            (intersperse bar* (rem [is _ ""] (macmap list tostring ,@body)))))


2 points by CatDancer 6417 days ago | link

Ah, the first argument to rem is automatically testified, so

  (mac w/bars body
    `(apply pr
            (intersperse bar* (rem "" (macmap list tostring ,@body)))))

-----