precept

Preception!
carkh 2017-12-23T18:29:44.000020Z

I thought i would give a try to precept again ... but i run in quite a few issues.

carkh 2017-12-23T18:31:12.000001Z

first i tried in a toy project of mine...but i run into problems with the session macro when reloading with figwheel ... it looks like it doesn't keep the fully qualified var names for my schemas... instead using locally qualified names

alex-dixon 2017-12-23T18:32:21.000070Z

Ok. Do you have a snippet of the code that seems to be the problem or a description of the error?

carkh 2017-12-23T18:32:25.000076Z

@carkh uploaded a file: https://clojurians.slack.com/files/U13RRNF2M/F8JT0V02G/-.clj

alex-dixon 2017-12-23T18:32:31.000045Z

🙂

carkh 2017-12-23T18:32:39.000040Z

ah you're faster than i am =)

alex-dixon 2017-12-23T18:32:56.000016Z

No I spoke too soon 🙂

carkh 2017-12-23T18:33:26.000045Z

see this code is in ss.precept.rules ns, and i get errors saying that ss.precept.rules/db-schema doesn't exist

carkh 2017-12-23T18:33:54.000002Z

although i'm providing a fully qualified name for my dbschema

carkh 2017-12-23T18:34:19.000069Z

so i thought i would give a spin to your examples

carkh 2017-12-23T18:35:03.000073Z

but there i see you are cheating ! there is no reloading due to ns ^:figwheel-no-load todomvc.app

carkh 2017-12-23T18:35:37.000087Z

(also there are quite a few warnings during compilation but we'll let that slide)*

alex-dixon 2017-12-23T18:36:13.000045Z

Thanks haha. Hopefully if I’m thinking of the same warnings you’re seeing they’re coming from Clara

carkh 2017-12-23T18:36:28.000001Z

anyways i've been looking at clara issues, and it seems they have a fix about this kind of namespaced var issues in their macros, maybe that's related

alex-dixon 2017-12-23T18:36:42.000056Z

Did you start your project using the template or something else?

carkh 2017-12-23T18:37:25.000038Z

not not using the template

carkh 2017-12-23T18:39:15.000067Z

the clara thing was fixed maybe a week ago...let me try to find it

alex-dixon 2017-12-23T18:39:17.000094Z

Hm ok. Have you tried restarting figwheel or refreshing the browser? I’m not sure the session recompiles when it receives new arguments or not

alex-dixon 2017-12-23T18:39:39.000072Z

Ok. Thanks. I’m only aware that they added hot reloading for CLJS, not sure about namespace related issues

carkh 2017-12-23T18:39:47.000015Z

i've been playing with it for half a day =) refreshing and restarting all vm aswell as figwheel itself

carkh 2017-12-23T18:39:53.000044Z

it seems very brittle

carkh 2017-12-23T18:40:02.000058Z

i'm using latest clojure and clojurescript though

alex-dixon 2017-12-23T18:40:34.000002Z

Ok. That should be fine

carkh 2017-12-23T18:40:50.000028Z

https://github.com/cerner/clara-rules/issues/359

alex-dixon 2017-12-23T18:40:53.000025Z

Is this a public repo where I could take a look?

carkh 2017-12-23T18:41:18.000030Z

i was afraid you would ask that ... I'll try to make a minimal example

carkh 2017-12-23T18:42:45.000007Z

btw thanks for your lightning fast responses =)

alex-dixon 2017-12-23T18:42:50.000075Z

Totally up to you. I’m looking through the source right now and trying to think and not ask a lot of silly questions…there’s a lot of trickyness to macros, especially in CLJS. But I’m working on a project that uses a db-schema and client schema right now and not getting any errors

alex-dixon 2017-12-23T18:43:02.000102Z

Np. Sorry you’ve burned half a day on this

carkh 2017-12-23T18:43:43.000050Z

precept has me quite excited, so there 's no problem there =)

alex-dixon 2017-12-23T18:43:44.000087Z

In what I’m working on I’ve required the schemas at the top

carkh 2017-12-23T18:44:26.000006Z

mhhh do you think the fact i'm using cider might pose a problem ?

alex-dixon 2017-12-23T18:44:32.000068Z

Glad to hear it. It’s just been me working on it and I haven’t had much time due to work recently so I’m sorry for the brittleness

alex-dixon 2017-12-23T18:44:55.000009Z

I don’t think so…

alex-dixon 2017-12-23T18:45:24.000082Z

Have you tried requiring the schemas at the top? I’m not using fully qualified in what I have working and sometimes even with fully qualified if they’re not required things don’t work

alex-dixon 2017-12-23T18:45:52.000036Z

[precept-visualizer.schema :refer [db-schema client-schema]]
(session visualizer-session
  'precept-visualizer.rules 'precept-visualizer.other-rules
  :db-schema db-schema
  :client-schema client-schema
  :reload true)

carkh 2017-12-23T18:46:06.000001Z

i haven't tried that

carkh 2017-12-23T18:46:30.000141Z

hum you're not even qualifying the vars and it works

alex-dixon 2017-12-23T18:46:32.000006Z

That’d be my best guess. I’m also using a .cljc file for the schemas but it should work with cljs too

carkh 2017-12-23T18:46:46.000020Z

let me try it here and i'll get back to you !

alex-dixon 2017-12-23T18:47:18.000057Z

Ok cool. I’ll try to think of something else but I think that might be it…seems like I’ve run into it before even with other clojure things

carkh 2017-12-23T18:55:19.000102Z

allright looks like it works with non-qualified names when explicitely importing them

carkh 2017-12-23T18:56:11.000048Z

so i guess my mistake, sorry for the bother !

alex-dixon 2017-12-23T18:56:56.000021Z

No problem at all. Really glad it worked

alex-dixon 2017-12-23T18:57:33.000081Z

It’s counterintuitive to me...like what’s the point of a fully qualified ns