This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: gnu.lists.PairWithPosition.toString() truncates the list?
- From: Per Bothner <per at bothner dot com>
- To: Ethan Herdrick <info at reatlas dot com>
- Cc: kawa at sourceware dot org
- Date: Mon, 19 May 2008 21:19:42 -0700
- Subject: Re: gnu.lists.PairWithPosition.toString() truncates the list?
- References: <91f48dbf0805191802l31c34d37y477087cfba831838@mail.gmail.com>
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/