I want to cross a vector tree representing hiccup data structures:
[:div {:class "special"} [:btn-grp '("Hello" "Hi")]]
Then I want to send a vector by keyword, if a multimethod is defined for this keyword, then it will return another set of vectors that will replace the original tag.
For example, the specified structure will be converted to:
[:div {:class "special"} [:div [:button "Hello"] [:button "Hi"]]]
A custom multimethod will receive a list (hello, hello) as parameters. Then it will return the div containing the buttons.
How to write a function that moves a vector and sends the keyword everything else in the form as a parameter, and then replaces the current form with the returned form?
source
share