I want a multislot of a class instance to become an empty list. I am not sure if there is a bug in clips or pyclips, or if I am doing it wrong.
import clips
C = clips.BuildClass("C", "(is-a USER)(multislot s)")
i = clips.BuildInstance("test1", C)
#i.Slots['s'] = clips.Multifield([]) # error
i.Slots['s'] = [] # error
#i.Slots['s'] = clips.Multifield(["1", "4"]) # no error
#i.Slots['s'] = ["1", "4"] # no error
print i.Slots["s"]
I am getting this error:
_clips.ClipsError: C09: unable to understand argument
Stacktrace:
File "\\VBOXSVR\vagrant\return_empty_list_bug.py", line 6, in <module>
i.Slots['s'] = [] # error
File "c:\Python27\Lib\site-packages\clips\_clips_wrap.py", line 175, in _WRAPPER
return f(self, *args)
File "c:\Python27\Lib\site-packages\clips\_clips_wrap.py", line 269, in _WRAPPER
return f(self, *newargs)
File "c:\Python27\Lib\site-packages\clips\_clips_wrap.py", line 2506, in __setitem__
_c.directPutSlot(self.__instance, name, _py2cl(v))
_clips.ClipsError: C09: unable to understand argument
The problem seems to be in file
clipsmodule.c
line 1788:I don't know why this check is there and what will be the effects if I uncomment it.