bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#65680: cl-print-to-string-with-limit erroneously imposes a maximum p


From: Drew Adams
Subject: bug#65680: cl-print-to-string-with-limit erroneously imposes a maximum print-length of 50
Date: Thu, 21 Sep 2023 19:22:11 +0000

> > 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]