Querying from the terminal doesn't print anything
问题 When ran in the command line, this swipl -g "write(42)" -t "halt" prints 42 to STDOUT as expected. However, this swipl -g "X = 42" -t "halt" does not print anything, it simply returns. How do I get it to print what it prints in the REPL (that is, X = 42 )? Note: this is in a Windows terminal. Let me know if this actually works in a Linux terminal. 回答1: As expected, X = 42 by itself produces no output whatsoever , because (=)/2 is a completely pure predicate that does not yield any side