Re: [Scheme-reports] vector-insert Per Bothner (20 Aug 2014 21:41 UTC)
Re: [Scheme-reports] vector-insert Taylan Ulrich Bayirli/Kammer (21 Aug 2014 09:08 UTC)
Re: [Scheme-reports] vector-insert Per Bothner (21 Aug 2014 16:13 UTC)
Re: [Scheme-reports] vector-insert Kevin Wortman (21 Aug 2014 17:00 UTC)
Re: [Scheme-reports] vector-insert Sascha Ziemann (22 Aug 2014 08:00 UTC)
Re: [Scheme-reports] vector-insert Kevin Wortman (23 Aug 2014 00:57 UTC)
Re: [Scheme-reports] vector-insert Vassil Nikolov (23 Aug 2014 22:36 UTC)

Re: [Scheme-reports] vector-insert Per Bothner 20 Aug 2014 21:31 UTC


On 08/19/2014 09:15 AM, Taylan Ulrich Bayirli/Kammer wrote:
> Also if I remember correctly, resizable vectors incur a general overhead
> on access, in addition to implementation complexity.  So they should
> likely be a separate library, no?

Simple re-sizable vectors require an indirection that might otherwise
not be needed.  This overhead is much less than using linked lists.

Many programs needs to "build" a sequence, typically appending at the end
each element as it is produced.  Using an array that gets reallocated (doubled)
when full is usually the most efficient representation.  Having a standard re-sizable
(growable) vector type would simplify the programming.

I added string-append! to Kawa.  It seems to be a good idea to also add vector-append!.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports