Changes to "printout" from 6.3 to 6.4?

12 views
Skip to first unread message

denis.be...@gmail.com

unread,
Nov 14, 2025, 12:21:04 AMNov 14
to CLIPSESG
I wonder if there has been any (undocumented) change to function printout (especially in case of output to the standard output).

Suppose I have defined a function foo-i(?i $?vars), that may take some time to run.
Suppose i want to iterate it over a large number of values of ?i. In Clips 6.3, I used to write something like:

(deffunction foo($?vars)

    (loop-for-count (?i 1 1000000)

        (printout t ".")

        (if (eq (mod ?i 100) 0) then (printout t crlf))

        (if (eq (mod ?i 10000) 0) then (printout t crlf ?i crlf))

        (foo-i ?i ?vars)

    )

)


In Clips 6.3, this allowed to simulate a rudimentary "progression bar", where each dot was printed every time a new value of ?i was started, with additional line separators for better tracking.
But in Clips 6.4, instead of being printed one by one, the dots get printed only after the crlf, making the first level of tracking useless.
Is there any way to force "printout" to do the printing every time it is called, before the line is completed? I can't find any "flush" function. (Best if it works for both 6.3 and 6.4 - I continue to use both.)
(I understand why it is more efficient not to do so when writing to a file.)

(Both 6.3 and 6.4 were run on MacOS 26.1)
.
   

CLIPS Support

unread,
Nov 14, 2025, 4:22:15 PMNov 14
to CLIPSESG
Output is no longer automatically flushed in CLIPS 6.4. You can use the flush function to do it, but it wasn't properly handling stdout so I checked a fix into the repository. You can use either (flush stdout) to specifically flush stdout or (flush) to flush all open files, stdout, and stderr.

denis.be...@gmail.com

unread,
Nov 15, 2025, 4:25:58 AMNov 15
to CLIPSESG
In the new release r695, you set BLOCK_MEMORY to 1 in setup.h.
I think this should be 0 by default, as it has a catastrophic impact on performance.
It was useful to be able to try with 1, but the penalty is too high.

CLIPS Support

unread,
Nov 15, 2025, 1:47:31 PMNov 15
to CLIPSESG
Thanks. Mistake on my part.
Reply all
Reply to author
Forward
0 new messages