almostearthling / pyclips

PyCLIPS - a Python module to integrate CLIPS into Python
Other
35 stars 18 forks source link

clips.BatchStar() and (batch ...) not working together #5

Open gitttt opened 7 years ago

gitttt commented 7 years ago

I have three files: 1.) A python filetest.py:

import clips
PATH_TO_CLP_FILE = r'd:\temp\batch_bug.clp'
clips.BatchStar(PATH_TO_CLP_FILE)
clips.PrintFacts()

2.) A file batch_bug.clp:

(assert (asdf0))
(batch "D:\\temp\\batchbug2.clp")
(assert (asdf1))
(printout t (facts))

And finally a file batchbug2.clp: (assert (fdsa))

python test.py results in the following output:

f-0     (initial-fact)
f-1     (asdf0)
f-2     (asdf1)
For a total of 3 facts.

[ENVRNMNT8] Environment data not fully deallocated.

[ENVRNMNT8] MemoryAmount = 22.

[ENVRNMNT8] MemoryCalls = 1.

This is not what I expected because there is no "fdsa" fact, i.e. calling (batch "D:\\temp\\batchbug2.clp") did not work. In addition, there are the [ENVRNMNT8] messages. What is going on here?

EDIT:

I found out about the CLIPS batch*(...) command. And using this instead of the batch(...) works as expected. Why is that?