Fork me on GitHub
#clara
<
2019-12-13
>
geraldodev01:12:32

The 1st (= ?cd_paciente cd_paciente) is a binding (since there are no other on the local scope. The second (= ?cd_paciente cd_paciente) is a comparison because the binding is already established right ?

ethanc01:12:06

That is correct

👍 4
geraldodev01:12:46

Its beautiful . (error prone too) if i remove a char of ?cd_paciente I got two bindings

ethanc01:12:38

Yeah, i've wondered if the Clara compiler should warn on unused bindings...

🤯 4
bartuka11:12:09

this could be very handy

mikerod15:12:48

@geraldodev yeah, because ?binding-name is just some arbitrary local name you want to give for the context

mikerod15:12:04

the warning isn’t a bad idea, @ethanc is a genius

ethanc15:12:08

I will log an issue for enhancement, when i get a few free seconds @mikerod

🎊 4
👍 4
geraldodev17:12:28

@mikerod the warnings from clj-kondo have improved a lot my experience with clojure.

truestory 4
mikerod17:12:49

@geraldodev I’ve started to play around with clj-kondo, but haven’t done so very seriously yet - it looks promising

mikerod17:12:11

for a Clara DSL thing though - not thinking it can help you much? like in the case of this variable binding thing?

mikerod17:12:26

I know it does have some pretty good extension points though - so can do some nice things

geraldodev18:12:14

@mikerod I've asked on #clj-kondo if it's possible to lint the unused binding case

geraldodev18:12:43

I think it's a work for a linter. But it's a very especific syntax. for macros that follows defn or def pattern you simply configure :lint-as on a config file like: {:lint-as {com.fulcrologic.fulcro.components/defsc clojure.core/defn }}

mikerod18:12:45

@geraldodev yeah, I’ve seen how to do that pattern following like you have above

mikerod18:12:48

I’ve used that one

mikerod18:12:58

but the clara DSL is of course more complicated

mikerod18:12:34

of course for unused, it may be just not finding the symbol more than one time in the entire DSL form hah

mikerod18:12:45

Ethan did log a Clara issue it looks like now though

mikerod18:12:34

His proposal targets more on the AST compilation side - which is better since the DSL layer is something that is “pluggable” in Clara (people could use their own and target same AST pre-compilation)

geraldodev18:12:57

Yesterday was my 1st day with clara. I'm enjoying.

geraldodev20:12:20

About processing facts that comes from sql databases on long running sessions. Because of mutation, one has to query the session looking for the fact based on the primary key of the table, compare it with the current value and if it's different retract the old fact and insert again. Is that correct ?

Eduardo Mata23:12:47

what does this even mean"

Java.lang.IllegalStateException: Attempting to call unbound fn: #'

Eduardo Mata23:12:50

ups wrong place