示例#1
0
    def slots(self):
        """Iterate over the Slots of the Template."""
        if self.implied:
            return ()

        data = clips.data.DataObject(self._env)

        lib.EnvDeftemplateSlotNames(self._env, self._tpl, data.byref)

        return tuple(
            TemplateSlot(self._env, self._tpl, n.encode()) for n in data.value)
示例#2
0
def slot_values(env, fact, tpl):
    data = clips.data.DataObject(env)
    lib.EnvDeftemplateSlotNames(env, tpl, data.byref)

    return ((s, slot_value(env, fact, s.encode())) for s in data.value)