Re: Floating point print Incompatibility SWI 5.10.2 versus 6.6.2
"Richard A. O'Keefe" <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
On 21/03/2014, at 11:56 PM, Jan Wielemaker wrote: > All debugging is traditionally printed using print/1, which traditionally uses unquoted write + portray. I believe I've seen a Prolog system that had printq/1, which was the obvious hybrid between print/1 and writeq/1. SWI Prolog already has the write_term/2 option portray_goal, something other Prologs would do well to pick up. > I've proposed > a while ago to change this to be quoted write + portray. Why does print/1 exist? Because Chris Mellish was trying to debug a program computing semantics for English where each goal filled more than one screen if written in full. print/1 was introduced so that you could *abbreviate* the debugging output of your program heavily. This idea of diligently protecting every little detail with quotation marks while simultaneously hiding >90% of everything didn't really make much sense. The output was never intended to be valid Prolog syntax. Most of the time when you are debugging, you'd like floating point numbers to be abbreviated heavily, to just a couple of digits. Anything more would be clutter, getting in the way of seeing what you need to see. But sometimes it is floating point code that you are debugging, and you need to see all the digits. It might be interesting to find out what people are using print/1 for. There might be conflicting use cases that would be better served by more/different options.