If this works, as it appearently does, then the manual should be updated to
remove the following quote:

"Only allows constructs to be evaluated."

since "(facts)" isn't a construct - at least I don't think it is...

Also, the docs on (eval ...) also state that only functions can be called.
Is this statement true? BTW - what part of the jess language *isn't* a
function?

alan

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Monday, June 11, 2001 5:21 PM
To: Thomas Gentsch
Cc: Jess
Subject: Re: JESS: Debug rule


The example you give here works fine for me in Jess 6.0a6 (see below.)
What version of Jess did you try it with?

----------------------------------------------------------------------

[ejfried@cp96277-a unit_tests]$ java jess.Main

Jess, the Java Expert System Shell
Copyright (C) 1998 E.J. Friedman Hill and the Sandia Corporation
Jess Version 6.0a6 5/3/2001

Jess>  (deftemplate TgeFact (multislot text))
TRUE
Jess> (defrule exec-itm_command-string
  (declare (salience 10000))
  ?f <- (TgeFact (text TGE-Command: ?cmd))
=>
  (build ?cmd)
  (retract ?f) )
TRUE
Jess> (watch all)
TRUE
Jess> (assert (TgeFact (text TGE-Command: "(facts)"))  )
 ==> f-0 (TgeFact (text TGE-Command: "(facts)"))
==> Activation: exec-itm_command-string :  f-0
<Fact-0>
Jess> (run)
FIRE 1 exec-itm_command-string f-0
f-0   (TgeFact (text TGE-Command: "(facts)"))
For a total of 1 facts.
 <== f-0 (TgeFact (text TGE-Command: "(facts)"))
1
Jess>                          




I think Thomas Gentsch wrote:
> 
> Hello,
> 
> I wanted to create a rule as some kind of an debugging-aid which allows
> me to submit facts that are interpreted as regular commands.
> I tried the following in different variations but can't get it to work
> as expected:
> 
> (defrule exec-itm_command-string
>   (declare (salience 10000))
>   ?f <- (TgeFact (text TGE-Command: ?cmd))
> =>
>   (build ?cmd)
>   (retract ?f)
> )
> 
> and asserted e.g.
>  (TgeFact (text TGE-Command: "(facts)"))
> 
> Nothing happens. Similraly I tried out (eval ) and multifields for ?cmd
> (passed as (explode$ ?cmd) of course.
> Is there any nice way how to accomplish that?
> 
> Thanks a lot,
>       tge
> 
> -- 
>      Thomas Gentsch
> 



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

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

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