squint

esp1 2025-02-05T07:40:35.328559Z

Would it be possible to have a function/macro equivalent of the #html reader literal where it wouldn't be necessary to tag all of the data in nested components with #html? e.g. instead of the following where the reader literals are needed for both the component and the argument being passed to it:

(defn my-html [x] #html [:<> [:div "Hello"] x])
(my-html #html [:div "Goodbye"])
could there be something like the ->html function/macro below that does not need reader literals at all?:
(defn my-html [x] [:<> [:div "Hello"] x])
(->html (my-html [:div "Goodbye"]))

borkdude 2025-02-05T07:41:51.036129Z

no since the html production is happening at compile time

borkdude 2025-02-05T07:42:43.707869Z

if you want runtime html production you can take a look at http://thi.ng hiccup which works fine in squint: https://docs.thi.ng/umbrella/hiccup/

esp1 2025-02-05T07:46:38.158999Z

oh cool thanks!