Title: Q on comparing the head of facts

I realize this is a newbie question, but I have read over the documentation and
am still perplexed.

Suppose I have a function that does something and returns a fact. Or, suppose I have
a query which returns a list of facts.  How do I check that the returned fact has a specific
head?  i.e. how do I check that the fact is, for example, a (house ...)?

I came up with:  (eq (call ?fact getName) "MAIN::house")   but I suspect there is a much
more intuitive way than this.?

On a similar note - how do I test the structure of the returned fact for other properties?
For example, suppose I simply have a fact set like:

(deffacts myfacts
   (house 34 "abc" 1995)
   (house (builtin 1993) (roofAge 19) (company "def") (ac "yes"))
   (house "ghi"))

If all of these facts, which have different structure and slots, are all returned from a query,
how do I filter the returned list by structure?  For example, filtering the ordered from the unordered facts.

What are the basic methods for exploring the structure of a returned fact?

Thanks in advance,
Todd Littell
System Analyst
U.S. Army Corps of Engineers
ERDC-CERL
2902 Newmark Dr.
Champaign, IL 61826-9005

1-800-USA-CERL ext. 7677

Reply via email to