Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created October 18, 2011 00:01
Show Gist options
  • Select an option

  • Save amalloy/1294255 to your computer and use it in GitHub Desktop.

Select an option

Save amalloy/1294255 to your computer and use it in GitHub Desktop.
jiraph.walk> (defmacro << [fname walk & args]
`((. ~(vary-meta `(traversal ~walk)
assoc :tag `Traversal)
~fname) ~walk ~@args))
#'jiraph.walk/<<
jiraph.walk> (-> (macroexpand '(<< add? x nil))
first second meta)
{:tag jiraph.walk.Traversal}
jiraph.walk> (fn [x] (<< add? x nil))
Reflection warning, NO_SOURCE_FILE:1 - reference to field add_QMARK_ can't be resolved.
#<walk$eval7741$fn__7742 jiraph.walk$eval7741$fn__7742@191c2c15>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment