[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Growable arrays?
From: |
David Kastrup |
Subject: |
Re: Growable arrays? |
Date: |
Mon, 11 Jun 2012 12:38:49 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
Daniel Hartwig <address@hidden> writes:
> On 11 June 2012 17:01, Daniel Hartwig <address@hidden> wrote:
>> For reference, attached is a growable vector I use in several
>> projects, adapted to support the length operation similar to Lua (i.e.
>> first unset numerical index). There is no catching of exceptions
>> here, every access to the data is through the dynvector procedures
>> which check the index and vector size.
>
> Always test before posting even small changes to existing code :-)
>
> Updated attachment to actually run without problems
Well, considering the cost of dynvector-grow!, doing the growth in a
loop rather then just the determination of the new size seems a bit
expensive:
(while (<= (dynvector-capacity dynvector) k)
(dynvector-grow! dynvector))
--
David Kastrup
- Growable arrays?, David Kastrup, 2012/06/09
- Re: Growable arrays?, Krister Svanlund, 2012/06/09
- Re: Growable arrays?, Daniel Hartwig, 2012/06/11
- Re: Growable arrays?, David Kastrup, 2012/06/11
- Re: Growable arrays?, Daniel Hartwig, 2012/06/11
- Re: Growable arrays?, David Kastrup, 2012/06/11
- Re: Growable arrays?, Daniel Hartwig, 2012/06/11
- Re: Growable arrays?, Daniel Hartwig, 2012/06/11
- Re: Growable arrays?,
David Kastrup <=
- Re: Growable arrays?, Daniel Hartwig, 2012/06/11
- Re: Growable arrays?, Noah Lavine, 2012/06/11
- Re: Growable arrays?, David Kastrup, 2012/06/11
- Re: Growable arrays?, Mark H Weaver, 2012/06/11
- Re: Growable arrays?, David Kastrup, 2012/06/12
- Re: Growable arrays?, Mark H Weaver, 2012/06/12
- Re: Growable arrays?, David Kastrup, 2012/06/12
- Re: Growable arrays?, Mark H Weaver, 2012/06/12
- Re: Growable arrays?, David Kastrup, 2012/06/12
Re: Growable arrays?, Thien-Thi Nguyen, 2012/06/11