Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

specify transformation with multimethod #198

Open
saitouena opened this issue Nov 26, 2019 · 0 comments
Open

specify transformation with multimethod #198

saitouena opened this issue Nov 26, 2019 · 0 comments

Comments

@saitouena
Copy link

I don't like constructing a map for transform. I want to write like this.

(defmulti trans (fn [tag & _] tag))

(defmethod trans :a
  [tag & xs]
  ;; body
  )

(defmethod trans :b
  [tag & xs]
  ;; body
  )

(defmethod trans :default
  [tag & xs]
  ;; body
  )

(insta/transform' trans parsed)

Currently hiccup tag is not passed to transform function. I'm thinking about adding transform' and hiccup-transform' to transform.cljc. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant