Arc Forumnew | comments | leaders | submitlogin
2 points by absz 5603 days ago | link | parent

I like this:

  (mac w/rfn (name withses . body)
    `(rfnwith ,name ,(mappend [list _ _] withses) ,@body))

  (mac w/afn (withses . body)
    `(w/rfn ,withses ,@body)
I have something like this for obj, actually, which I use for creating structure-like tables:

  (mac nobj args
    " Creates a table from the list of variables passed to it; each variable's
      name is keyed to its value.  E.g. if x = 10 and y = -10, then (nobj x y)
      results in #hash((y . -10) (x . 10)).
      See also [[obj]] [[table]] "
    `(obj ,@(mappend [list _ _] args)))


2 points by conanite 5603 days ago | link

don't forget the name parameter to w/rfn in w/afn

  (mac w/afn (withses . body)
    `(w/rfn self ,withses ,@body)

-----

1 point by absz 5602 days ago | link

Whoops, you're right. My bad.

-----