Re: HAMT iterator

2020-10-11 Thread Bruno Haible
Marc Nieper-Wißkirchen wrote: > > - If someone creates a derivative of the HAMT, the iterator won't > > be affected, right? ("persistence") > > Yes. OK, that's one thing to document. > > So, what is the scenario where increasing the reference count will make > > a difference? > > If you

Re: HAMT iterator

2020-10-11 Thread Marc Nieper-Wißkirchen
Am So., 11. Okt. 2020 um 14:04 Uhr schrieb Bruno Haible : > > Marc Nieper-Wißkirchen wrote: > > > > /* Return an independent copy of ITER that is initially in the same > > > >state. */ > > > > extern Hamt_iterator *hamt_iterator_copy (Hamt_iterator *iter); > > > > > > Then a copy function is

Re: HAMT iterator

2020-10-11 Thread Marc Nieper-Wißkirchen
k, between the various function calls. > > If you iterate with hamt_iterator_create, and the Hamt_iterator type > has bounded size (I guess it will not require more than 15 pointers and > 13 indices), it can be stored on the caller's stack. That's a very good point you make. The hamt iterator has, of course, (low) bounded size, so it can (and should) be allocated on the stack.

Re: HAMT iterator

2020-10-11 Thread Bruno Haible
Marc Nieper-Wißkirchen wrote: > > > I am going to implement the following iterator API as well: > > > > > > /* An alternative interface to iterating through the entry of a hamt > > >that does not make use of a higher-order function like > > >hamt_do_while uses the opaque Hamt_iterator

Re: HAMT iterator

2020-10-11 Thread Bruno Haible
Marc Nieper-Wißkirchen wrote: > > > /* Return an independent copy of ITER that is initially in the same > > >state. */ > > > extern Hamt_iterator *hamt_iterator_copy (Hamt_iterator *iter); > > > > Then a copy function is not needed, because the user's program can do > > > > Hamt_iterator

Re: HAMT iterator

2020-10-11 Thread Marc Nieper-Wißkirchen
Am So., 11. Okt. 2020 um 13:02 Uhr schrieb Bruno Haible : > > Hi Marc, > > > I am going to implement the following iterator API as well: > > > > /* An alternative interface to iterating through the entry of a hamt > >that does not make use of a higher-order function like > >hamt_do_while

Re: HAMT iterator

2020-10-11 Thread Bruno Haible
Hi Marc, > I am going to implement the following iterator API as well: > > /* An alternative interface to iterating through the entry of a hamt >that does not make use of a higher-order function like >hamt_do_while uses the opaque Hamt_iterator type. */ > typedef struct hamt_iterator