Re: JESS: Using a string in a bind or as a jess command
Thanks Ernest, That's exactly what I was looking for. I vaguely remember seeing it in your book once, but for some reason it just didn't register. Thanks again, Bret --- [EMAIL PROTECTED] wrote: > I think Bret Kellihan wrote: > > > > Also, Is there anyway to build up an entire jess > > expression into a variable and then execute it? > I've > > tried something on the lines of: > > > > (bind ?command (str-cat "(bind ?x 1)")) > > (?command) > > The "eval" function parses and evaluates a String > (or a variable > containing a String, or a function call returning a > String, etc) > containing Jess code: > > Jess> (eval "(bind ?x 1)") > 1 > Jess> ?x > 1 > > > > > - > Ernest Friedman-Hill > Advanced Software Research Phone: (925) > 294-2154 > Sandia National LabsFAX: (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] > > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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]
Re: JESS: Using a string in a bind or as a jess command
I think Bret Kellihan wrote: > > Also, Is there anyway to build up an entire jess > expression into a variable and then execute it? I've > tried something on the lines of: > > (bind ?command (str-cat "(bind ?x 1)")) > (?command) The "eval" function parses and evaluates a String (or a variable containing a String, or a function call returning a String, etc) containing Jess code: Jess> (eval "(bind ?x 1)") 1 Jess> ?x 1 - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National LabsFAX: (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]
JESS: Using a string in a bind or as a jess command
Hello, I've been trying to use a string as a variable anme in a bind call and I can't quite figure out how to do it. I'd like to be able to do this: (bind (str-cat "?" "myVar") 1) Jess throws an error saying "?myVar" is a string and not a variable, which of course is correct. In practice my example is a little more complicated, but this get's at the heart of it. Is there anyway to turn the string into an atom? Also, Is there anyway to build up an entire jess expression into a variable and then execute it? I've tried something on the lines of: (bind ?command (str-cat "(bind ?x 1)")) (?command) Again, it views the command as a string when passed to call. ANy ideas on how one might go about this? Thanks in advance, Bret __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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]