I'm trying to write usage instructions for this newLISP
program I've made but it keeps complaining about the string being too long.
ERR: string token too long : "$$$$$$$$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"
I spent some ten minutes cursing newLISP
and coming up with paranoid theories like, maybe you shouldn't have quotes in the string or maybe it'll work when I use raw strings({}
), until I started chopping the string. It reached a point where the message dissappeared leaving the help message very unhelpful. Turns out newLISP
doesn't like strings that have more than 2048(2^11)
characters. Soo,
Why put a limit on the number of characters in a string literal?
Why 2048 characters?
Increasing cell memory to 128MB
(saw it the manual) doesn't change anything. The only solution that works now(a hackish one), is splitting the help string into two strings each under 2048
characters then concatenating them with string
.
The other strange thing is that any string that has 2048+
characters is printed differently in the repl:
> (dup "&" 2048)
[text]&&&&&&&&&&&&&& .....
......
&&&&&&&&&&&&&&&[/text]
> (dup "&" 2040)
"&&&&&&&&&&&&&&&&&&& .....
.....
&&&&&&&&&&&&&&&"
There are three ways to do strings:
From the manual:
Strings can be quite long:
The only problem you'll have is when you want to process source code in strings that might contain a
[/text]
tag before you want the string to really end. It doesn't look like you're at that point yet... :)