Userfunctions don't really have a pretty-print representation. In general, the output of PrettyPrinter is Jess code, and since most Userfunctions are classes defined in Java, there isn't any way to sensibly implement visit(Userfunction).

On Jul 7, 2007, at 5:39 PM, Wolfgang Laun wrote:

This is surprising:

(deffunction ppallfunctions ()
 (bind ?sb (new StringBuffer))
 (bind ?it ((engine) listFunctions))
   (while (?it hasNext)
     (bind ?f (?it next))
;; The following call isn't possible because the intrinsic functions
;; don't implement jess.Visitable, and the only constructor for
;; jess.PrettyPrinter has an argument of this type.
;;    (?sb append (new jess.PrettyPrinter (?f)))
      (?sb append "
")
   )
   (?sb toString)
)

OK, one can filter the "unhospitable" functions, but what's the point
in returning objects that cannot be processed in the usual way?


---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550                 http://www.jessrules.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]
--------------------------------------------------------------------

Reply via email to