Esempio n. 1
0
    def find_class(self, name):
        """Find the Class by its name."""
        defclass = lib.EnvFindDefclass(self._env, name.encode())
        if defclass == ffi.NULL:
            raise LookupError("Class '%s' not found" % name)

        return Class(self._env, defclass)
Esempio n. 2
0
def classes(env, names):
    for name in names:
        defclass = lib.EnvFindDefclass(env, name.encode())
        if defclass == ffi.NULL:
            raise CLIPSError(env)

        yield Class(env, defclass)