Skip to content

specify transformation with multimethod #198

@saitouena

Description

@saitouena

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions