pact icon indicating copy to clipboard operation
pact copied to clipboard

Some (print ) are not printed

Open CryptoPascal31 opened this issue 2 years ago • 2 comments

Example 1:

(let ((x 0))
  (print "First statement")
  (print "Second statement")
  (print "Last statement")
)

Only outputs Last statement

Example 2:

(env-enable-repl-natives true)
(module test-print G

  (defcap G() true)

  (defun speak ()
    (print "First statement")
    (print "Second statement")
    (print "Last statement")
  )
)

(test-print.speak)

Only outputs Last statement as well

This behavior in painful for people like me, who use (print ) for debugging purpose.

CryptoPascal31 avatar Jan 10 '23 10:01 CryptoPascal31

This is a known issue that relates to how print is implemented. Basically, it's effectively a queue of depth 1 that gets overwritten by the later print statements. We are currently working on a change to how print functions that will address this.

jwiegley avatar Jan 11 '23 06:01 jwiegley

Pinging @jmcardon who has been working on this issue.

jwiegley avatar Jan 11 '23 06:01 jwiegley