GNU bug report logs -
#65680
cl-print-to-string-with-limit erroneously imposes a maximum print-length of 50
Previous Next
Reported by: Alan Mackenzie <acm <at> muc.de>
Date: Fri, 1 Sep 2023 14:18:02 UTC
Severity: normal
Done: Alan Mackenzie <acm <at> muc.de>
Bug is archived. No further changes may be made.
Full log
Message #28 received at 65680 <at> debbugs.gnu.org (full text, mbox):
> > I still believe that not truncating strings is better than truncating
> > them to the minute length of 50. In fact, why truncate strings at all
> > in cl-prin1? They're not truncated in prin1, etc.
>
> The main purpose of `prin1` is to print Sexp in a way that can be
> read back. I.e. for machine-consumption.
> The main purpose of `cl-prin1` OTOH is for human consumption.
> For this reason it started truncating strings while `prin1` doesn't
> bother doing so.
Not to muddy the waters too much, but FWIW: `cl-prin1'
is a far cry from an emulation of Common Lisp `prin1'.
(And for Common Lisp `prin1' there is _no_ truncation.
That is, nothing in the standard allows for truncation.
But _implementations_ could provide an option that
allows for truncation, AFAICS.)
> > It doesn't. String lengths are a completely different kettle of fish
> > from list lengths.
>
> Not completely: they're all concerned with truncating the output so the
> human gets to see what comes afterwards, and to a large extent their
> optimal value for any given string/list/vector is probably one that
> corresponds more or less to the same output string length.
FWIW: Common Lisp treats strings very differently
from arrays, vectors, and lists. It specifically
does not let variable `*print-length*' apply to
strings (and there is no other var that does so).
> > To solve this problem properly, we need, as Eli has
> > suggested, a separate variable called something like
> > print-string-length, to be set independently of
> > print-length (and print-level).
>
> Sounds good.
Yes, that would be reasonable.
This bug report was last modified 1 year and 309 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.