This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: gnu.lists.PairWithPosition.toString() truncates the list?
OK, what do you recommend for something that will take
'(1 2 3 4 5 6 7 8 9 10 11 12)
and return
"(1 2 3 4 5 6 7 8 9 10 11 12)"
On Mon, May 19, 2008 at 9:19 PM, Per Bothner <per@bothner.com> wrote:
> Ethan Herdrick wrote:
>>
>> The toString for gnu.lists.PairWithPosition truncates lists with more
>> than ten elements. Why?
>>
>> #|kawa:1|# (*:toString '(1 2 3 4 5 6 7 8 9 10 11 12 13))
>> |(1 2 3 4 5 6 7 8 9 10 ...)|
>
> To avoid cycles or really long/deep lists.
>
> toString isn't really suitable for "bulk" output - it's more suited
> to debugging and similar things. For example IDEs like NetBeans
> display objects using toString. We could hack toString so it
> catches cycles (which would be desirable in itself), but listing
> a really list is also awkward and wasteful.
>
> Also, toString doesn't interact well with pretty-printing, or
> other formatting.
>
> Finally, toString is very inefficient for creating output from
> nested data structures such as lists, because if the need to
> copy and concatenate strings.
> --
> --Per Bothner
> per@bothner.com http://per.bothner.com/
>
--
Ethan Herdrick
www.biographicon.com - Everyone's biography.