在 jess 中,从规则返回字符串的方法如下:
(defrule welcome-toddlers
"Give a special greeting to young children"
(person {age < 3})
=>
(printout t "Hello, little one!" crlf))
Run Code Online (Sandbox Code Playgroud)
我的问题是如何实现返回功能,这就是我想要的:
(defrule welcome-toddlers
"Give a special greeting to young children"
(person {age < 3})
=>
(return "Hello, little one!"))
Run Code Online (Sandbox Code Playgroud)
如果不可能怎么办?