0
我不想匹配jess-object的值(字符串),而比較值是字符串和另一個字段的組合。Jess-Rule:Str-Cat字段比較不會編譯
這裏一個簡單的( 「可運行」)例如:
(defclass Person (is-a :THING) (slot name (type string)) (slot email (type string)))
(mapclass Person)
(make-instance Andy of Person (name "Andy") (email "[email protected]"))
(defrule search
(object (OBJECT ?tmpPerson)
(is-a Person)
(email (str-cat (slot-get ?tmpPerson name) "@mail"))
)
=>
(print t "found")
)
但代碼不JessTab編譯。看來,該字段名 「名」 後的 「(」 是不允許的
錯誤:
Jess reported an error in routine Jesp.parsePattern.
Message: Bad slot value at token '('.
Program text: (defrule search (object (OBJECT ?tmpPerson) (is-a Person) (name ( at line 5.
我怎樣才能解決這個
謝謝?推進
非常感謝。這使得我的一天:-) – user2667549
改爲[...](email =(str-cat(slot-get?tmpPerson name)「@mail」))(我的錯誤,我想輸入「email」-Slot而不是「名稱」) – user2667549