Hi David, > I am very pleased to read that you think it is important to enable > truncated printing as a default for backtrace, I think so to. But > maybe Guile could provide an easy mechanism to overwrite these > defaults, using procedures, or parameters? (not depending on an > 'external' variable I mean (*)
You can see now that there are pressures coming from both directions on this issue. There are complaints that we truncate too much information, and other complaints that we don't truncate often enough. There are proposals to never truncate anything by default, and proposals to truncate everything by default. > I wrote "these defaults", "procedures or parameters", using plural, > because I think that the default should also enable truncated printing > for the repl and the raised exception system, what do you think? I'm reluctant to truncate REPL output by default for a few reasons: (1) Historically, the Guile has never truncated REPL output, and I'm concerned that changing the default behavior may violate longstanding user expectations. I, for one, often ask for a moderately large data structure to be computed and printed at the REPL, and I normally want to see the whole thing. (2) Some software may act as a front-end for the Guile REPL, sending commands to it and interpreting the output. For example, I believe that Geiser does this. I'm concerned that changing the default truncation behavior may cause problems here. (3) I'm not confident that 'truncated-print' is fully robust for arbitrary data types. I would need to make a careful audit of the code. (4) The Guile REPL already provides a way to specify a custom printer, so there's nothing stopping you from installing 'truncated-print' as the REPL printer. Regarding truncating exception printing by default, I'm inclined to think that it's better to err on the side of printing too much than too little. If an uncaught exception occurs, that clearly indicates an error, and if we truncate the error report, that might make the difference between being able to figure out what went wrong and being unable to do so, especially if the error is not easily reproducible. Your position on this is pretty much the opposite of what Robert Vollmert is advocating here, although to be precise he's talking about backtraces whereas you're now talking about exception conditions. Still, they both seem to be in the same area. To be honest, the main reason I find lack of truncation painful sometimes is because Emacs does not cope well with extremely long lines, to put it mildly. Honestly, that's a flaw in Emacs, and it seems like it would be better to fix Emacs than to work around it in Guile by omitting potentially useful information from error reports by default. I need to think more on this. In the meantime, I welcome opinions. Regards. Mark