I think Felix H. Bachmann wrote: > I have a module, let's say "X" that contains a defquery let's say "Y" and a rule > that runs the query (same module). > > Strangely, in the run-query command I have to specify the module name and the > query name (X::Y) to make the query work. Just using the query name gives me > the message that the query isn't defined. > > What's wrong? >
Because run-query is an ordinary function, not a special form, the rule compiler doesn't know that Y is a query name, so the bare query name is included in the compiled rule. When the run-query executes at runtime, the query name is resolved in the context of the "current" module, which is the module that new constructs are added to by default. If you've defined another module since you defined X, then Y won't be found. run-query *should* look in the module of the rule it is being called from, so I'd call this a bug. Thanks for the report. --------------------------------------------------------- Ernest Friedman-Hill Science and Engineering PSEs Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://herzberg.ca.sandia.gov -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] --------------------------------------------------------------------
