Re: string too long from write-char

[email protected] (Don Cohen)
Newsgroups gmane.lisp.clisp.general
Message-ID <[email protected]>
    [3]> (copy-utl2 *terminal-io*)
    [ writes 160000 spaces ]

BTW, the reason for 160000 was that all my cursor positioning 
multiplies the number of output characters by ~ 5e6/160000

I now have followed the code a little further back - yes it's due to
readline. 
stream.d :
#ifdef GNU_READLINE
/* We use the GNU Readline-Library. It returns the Input line-by-line,
   with possibility for editing, completion and History. unfortunately we
   have to save the Output intermediately line-by-line in order to be able to
   use the last commenced line as "Prompt". */
#define HAVE_TERMINAL3
/* define TERMINAL_LINEBUFFERED  1
   define TERMINAL_OUTBUFFERED   1 */
#endif

and this causes it to save a string containing the current line

So, if you have readline in your lisp, writing spaces to *terminal-io*
does eventually lead to
 *** - string too long: desired length ...
exceeds the supported maximum length

I just got that from a fresh clisp doing
(loop for i below 6000000 do (write-char #\space *terminal-io*))

However the number is quite a bit larger if you use a 64 bit build.

So my suggestion now is that readline be specifically limited to
some reasonable buffer size, like maybe one million characters.

------------------------------------------------------------------------------
_______________________________________________
clisp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.