The documentation is correct. Build is only guaranteed to work for
constructs, and eval only for functions. These meanings are inherited
from CLIPS.
Now, if each of them works on both constructs -and- functions, well,
these are undocumented side effects, and you use them at your own
peril.
Truth: the two share the same code -- they are synonyms. But someday,
they might not be, so use them as documented.
Regarding what is a construct and what is a function: invoke
(list-function$). Those are all the functions. Anything else is a
construct. What's the difference? Basically, only that constructs are
handled specially by the parser, so you can build aq "defrule
Funcall." You need to invoke the parser -- which is what (build) does.
I think Alan Moore wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> 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]
> ---------------------------------------------------------------------
>
---------------------------------------------------------
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]
---------------------------------------------------------------------