This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-24
Channels
- # adventofcode (33)
- # beginners (15)
- # cider (6)
- # clara (24)
- # cljs-dev (3)
- # clojure (39)
- # clojure-france (1)
- # clojure-greece (1)
- # clojure-norway (1)
- # clojure-spec (9)
- # clojure-uk (1)
- # clojurescript (40)
- # defnpodcast (1)
- # fulcro (9)
- # hoplon (33)
- # jobs-discuss (4)
- # lumo (3)
- # off-topic (4)
- # onyx (2)
- # parinfer (7)
- # precept (45)
- # re-frame (25)
- # ring-swagger (4)
- # shadow-cljs (2)
- # specter (3)
- # sql (10)
- # uncomplicate (3)
- # unrepl (8)
so I think i understand now, the session macro is pulling the code from all rules and expanding it in the namespace were it's used ...so if i put the session macro in precept.todomvc.session, i'll have trouble
but then how do you do a large project, where you can't possibly have all rules in a single file
Hm. Well you should be able to have multiple namespaces
(session ‘my-ns ‘other-ns ...)
but then i see that it complains about missing vars like precept.todomvc.session/insert!
that thing doesn't exist...it's actually picking it from the precept.todomvc.rules namespace
Yarg. Ok
i just took the template and moved the session macro call from precept.todomvc.rules to a new precept.todomvc.session namespace
So i’m trying to reproduce, but I have a working example where rules can be defined in one namespace without a session definition
Then in another namespace with rules I have the session defined at the very bottom of the file
(session visualizer-session
'precept-visualizer.rules
'precept-visualizer.other-rules
:db-schema db-schema
:client-schema client-schema
:reload true)
And that produces a session with rules from both namespaces
I did have to require ’precept-visualizer.other rules at the top of the ns where the session is defined (in precept-visualizer.rules)
Well, this isn’t something I’ve tried before, so it might actually be a bug
If you’re just looking to get something working with multiple namespaces I know for sure that’s possible if the session is defined in a namespace that has rules in it
I’ll work on reproducing but if keeping the session in the same ns as some of your rules isn’t a problem and you’d like help with that I can assist with that
i know i can make it work by adding soemthing like this to the sesison namespace : [precept.util :refer [insert! insert-unconditional! retract! guid] :as util]
but the problem is getting worst when i start adding my own things ... for instance i have that log function i was importing in the rules namespace ....and of course it's also complaining about that ...which makes sense in a way..it was looking for precept.todomvc.session/log (translated to our exemple here)
as it is right now, i need to know everything that's called from the session, and import it all, losing the namespace property of...namespacing... if you see what i mean
but hey with Christmas coming, don't feel pressured or anything =) there's no hurry on my side ! just wanted to let you know some troubles i ran into
Np this is great feedback so thanks
Had to take a call but will work on reproing. If you can keep the session def in a ns with rules you should be able to require other nses with just rules
Ok. I’ll file a bug if I can’t find a way to define a session in a separate ns with no rules
So far that seems the case so thanks for pointing it out
the underlying issue is that the session macro is not properly qualifying the symbols found in those rules