Fork me on GitHub
#cursive
<
2017-06-26
>
misha13:06:52

@cfleming greetings! is there a way to custom-resolve macro? resolve as def/defn does not help me here:

zylox14:06:17

hey, someone using clara 👍

zylox14:06:54

the answer last i heard was that there is not a way right now but he is working on a way to custom define macros. he has one internally but it is not ready for external exposure. current resolved macros are custom defined by Colin.

zylox14:06:40

as someone who writes in a rules based dsl for the majority of my day, i greatly look forward to its release.

zylox14:06:13

best ive found is to define then as def at the moment unfortuantely

misha14:06:42

@zylox thanks, was expecting that, but hoping for docs to be outdated

favila14:06:01

@misha if your macro is at least a little bit like some other form already in clojure, you can use one of those

misha14:06:36

not really using clara yet, but digging into rule-based-systems as part of the quest to simplify/organize tons of UI state I am going to have.

favila14:06:53

I have some macros that act like if-let and when-let

misha14:06:21

@favila on the screenshot defn macro resolution is applied, which helped only to recognize foo, and prevent highlighting to leak out of the top form.

favila14:06:52

I'm surprised url was not understood as a local var

misha14:06:30

I think destructuring form after the :put messes it up.

zylox14:06:37

since there could be multiple conditions on the left hand side its pretty much hopeless to try and parse it as a defn

misha14:06:35

I spent 5 minutes on implementing a macro accepting '[] instead of spliced list of :lhs => :rhs, but didn't get it yet :)

misha14:06:20

that quote would make def resolution work

zylox14:06:18

im not sure i would reccomend morphing your code to match the ide like that haha

misha14:06:43

that's why I dropped it

cfleming23:06:52

@misha Yes, sadly @zylox’s answer is correct - I haven’t got to this yet. defn is unlikely to work very well since it has to parse the whole form, and defrule looks quite different, it’s only superficially similar.

cfleming23:06:34

Looking at the doc, the tricky bit is going to be that rules can refer to fields from records implicitly.

cfleming23:06:46

I’m not quite sure how to handle that, I’ll think about it.

zylox23:06:48

Ya implicit references are pretty important.

zylox23:06:16

Additionally you can do a lot of destructuring style things

zylox23:06:31

And the types of the constraints can be non record types.

zylox23:06:40

So.. Ya it's gonna be rough