Clojurians
#precept
<
2017-07-12
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

julianwegkamp17:07:56

Hi, I'm trying out precept but even my most basic experiment doesn't work...

alex-dixon17:07:13

Sorry to hear that. What seems to be the trouble?

julianwegkamp17:07:34

Hi Alex, let me try to paste the code

julianwegkamp17:07:46

`(ns precept-test.core (:require [precept.core :refer [start! then]] [precept.rules :refer-macros [define defsub session rule]])) (enable-console-print!) (println "This text is printed from src/precept-test/core.cljs. Go ahead and edit it and see reloading in action.") (rule println-when-fact-with-some-attr [[_ :some-attr true]] => (println "Yes")) (session my-session 'precept-test.core) (start! {:session my-session :initial-facts [[123 :some-attr true]]})`

julianwegkamp17:07:06

hmmm, at least it is readable

julianwegkamp17:07:43

I'm using figwheel and have tried to reload, restart etc

alex-dixon17:07:32

Ok. Seems like it should work. Have you restarted figwheel completely? i.e. control c, run lein figwheel again?

julianwegkamp17:07:58

the only thing I didn't try is lein clean...

julianwegkamp17:07:38

trying right now

alex-dixon17:07:00

Ok. Is the println Logging?

julianwegkamp17:07:51

the println in the rule isn't

julianwegkamp17:07:07

the other one is

julianwegkamp17:07:47

can i see what rules and facts are in the session?

alex-dixon17:07:27

@precept.state/store should show facts that are a mirror of what’s in the session

alex-dixon17:07:14

Unfortunately I’m short on attention ATM. The only thing I can think of that’s different is that the session and start! are being used in the same namespace

julianwegkamp17:07:46

ok, no problem

julianwegkamp17:07:23

I'll put the session in a separate ns and try again

julianwegkamp17:07:39

thx for your quick response

julianwegkamp17:07:53

I'll be back :wink:

julianwegkamp17:07:10

Aha, I should have looked more closely at the docs...

julianwegkamp17:07:06

:initial-facts in precept.core/start! should be :facts

julianwegkamp17:07:28

It's an error in the readme

alex-dixon17:07:55

Sorry…will create an issue

alex-dixon17:07:16

Thanks for sticking with it and catching it for us

julianwegkamp17:07:40

I can at least move on with a more complicated rule

alex-dixon17:07:49

Awesome. Issue logged will fix when I have a sec. Let me know if you run into any more trouble