Fork me on GitHub
#helix
<
2020-10-19
>
geraldodev13:10:20

anyone using a macro to omit ^:native ?

ordnungswidrig07:10:44

“omit” or “emit”? :thinking_face:

danielneal14:10:53

I don't think that's possible, because the metadata special character is processed at read time, before macro expansion. Think you'd need to do (with-meta ... {:native true})

geraldodev14:10:48

#?(:clj (defmacro $n [type & args] (let [type (if (instance? clojure.lang.IObj type) (with-meta type {:native true}) type)] (helix/$ type @args))))`

danielneal14:10:32

does that work?

danielneal14:10:01

I do remember trying to do this at one point, I remember it being fiddly

geraldodev14:10:44

I've coded today. It's woking as far I can see. I'm asking to know your thougths on this.

dominicm15:10:41

@geraldodev one minor thing about your macro, you should assoc that metadata on I think, rather than setting it.

👍 3