precept

Preception!
julianwegkamp 2017-07-12T17:02:56.230455Z

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

alex-dixon 2017-07-12T17:03:13.239832Z

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

julianwegkamp 2017-07-12T17:03:34.251322Z

Hi Alex, let me try to paste the code

julianwegkamp 2017-07-12T17:03:46.258287Z

`(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]]})`

julianwegkamp 2017-07-12T17:04:06.269453Z

hmmm, at least it is readable

julianwegkamp 2017-07-12T17:04:43.290501Z

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

alex-dixon 2017-07-12T17:05:32.318201Z

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

julianwegkamp 2017-07-12T17:05:58.333336Z

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

julianwegkamp 2017-07-12T17:06:38.354800Z

trying right now

alex-dixon 2017-07-12T17:07:00.366552Z

Ok. Is the println Logging?

julianwegkamp 2017-07-12T17:07:51.394598Z

the println in the rule isn't

julianwegkamp 2017-07-12T17:08:07.403203Z

the other one is

alex-dixon 2017-07-12T17:08:12.405854Z

Ok

julianwegkamp 2017-07-12T17:08:47.425561Z

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

alex-dixon 2017-07-12T17:09:27.447627Z

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

julianwegkamp 2017-07-12T17:10:23.478991Z

empty map

alex-dixon 2017-07-12T17:11:14.507017Z

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

julianwegkamp 2017-07-12T17:11:46.524943Z

ok, no problem

julianwegkamp 2017-07-12T17:12:23.546122Z

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

julianwegkamp 2017-07-12T17:12:39.555169Z

thx for your quick response

julianwegkamp 2017-07-12T17:12:53.562824Z

I'll be back 😉

julianwegkamp 2017-07-12T17:33:10.249542Z

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

julianwegkamp 2017-07-12T17:35:06.313430Z

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

julianwegkamp 2017-07-12T17:35:28.326062Z

It's an error in the readme

alex-dixon 2017-07-12T17:35:29.326406Z

Doh!

alex-dixon 2017-07-12T17:35:55.341389Z

Sorry…will create an issue

julianwegkamp 2017-07-12T17:36:10.349528Z

no problem

alex-dixon 2017-07-12T17:36:16.353208Z

Thanks for sticking with it and catching it for us

julianwegkamp 2017-07-12T17:36:40.367114Z

I can at least move on with a more complicated rule

julianwegkamp 2017-07-12T17:37:05.381236Z

thx

alex-dixon 2017-07-12T17:37:49.405844Z

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

julianwegkamp 2017-07-12T17:37:59.411785Z

will do