Indeed, the "return" function is effectively overloaded; it does something entirely different when called from the RHS of a rule than it does when called anywhere else. Your expectation is correct: the "return" in the function will not affect the focus stack.

On Jul 20, 2007, at 11:29 AM, D Moon wrote:

Dr. EF-H and other Jess Users,

I would like to confirm that Jess functions are not partitioned by module (like rules and facts are) and therefore do not affect module focus.

E.g. I have a global.clp that contains a set of rules defmodule'd into MAIN:: but I also define in global.clp some functions for use from the MAIN::, as well as from other modules. (I have organized my code so that all non-module specific code goes into global.clp.)

So in another module (e.g. SCORE), I'm firing a rule with a RHS that calls the function defined in global.clp. If I have an explicit (return) in the function, I hope that *the function* returns, but that the SCORE module is not popped from the focus stack -- as is the case in a (return) from the RHS of a rule. Due to the facts I have in working memory, even with (watch all) I am having difficulty determining whether my function is popping the SCORE module or whether SCORE is popping due to no more activated SCORE rules to fire.

I am using Jess 7.0b5 (1/5/2006).

V/R,

Moon

---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550                 http://www.jessrules.com

--------------------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to