Re: Non-opaque hamt type?

2021-04-03 Thread Bruno Haible
Hi Marc, > Secondly, after having given it some more thought, the alternative protocol > (which we have called more robust) seems to be harder to understand because > "p != e" could then mean two different things. So I will leave the original > protocol in place, which is easy to comprehend: If

Re: Non-opaque hamt type?

2021-04-03 Thread Marc Nieper-Wißkirchen
Please excuse the delay in finalizing the new module. I was distracted due to the start of the semester in October last year and then forgot to finish my work. To summarize, I have finally come to the conclusion not to change the API as theorized in this thread. First of all, the benefits of

Re: Non-opaque hamt type?

2020-10-18 Thread Marc Nieper-Wißkirchen
Okay, if you find the latter protocol better anyway, I will switch to this protocol, and hamts will be stack-allocated (just two words) and passed by value. Thanks, Marc Am So., 18. Okt. 2020 um 19:58 Uhr schrieb Bruno Haible : > > Marc Nieper-Wißkirchen wrote: > > The existing protocol is as

Re: Non-opaque hamt type?

2020-10-18 Thread Bruno Haible
Marc Nieper-Wißkirchen wrote: > The existing protocol is as follows: > > Hamt_entry *e = hamt_entry (...); > Hamt_entry *p = e; > Hamt *new_hamt = hamt_insert (old_hamt, ); > if (old_hamt == new_hamt) > { > /* The element hasn't been insert as an equivalent element has already > been in

Re: Non-opaque hamt type?

2020-10-18 Thread Marc Nieper-Wißkirchen
Am So., 18. Okt. 2020 um 16:39 Uhr schrieb Bruno Haible : > > Hi Marc, > > > At the moment, the header file exposes an opaque struct Hamt and > > communication with the code happens through (stack-allocated) pointers > > to a Hamt. In the implementation, however, each Hamt just consists of > > two

Re: Non-opaque hamt type?

2020-10-18 Thread Bruno Haible
Hi Marc, > At the moment, the header file exposes an opaque struct Hamt and > communication with the code happens through (stack-allocated) pointers > to a Hamt. In the implementation, however, each Hamt just consists of > two pointers (a pointer to a function table and a pointer to the > root),

Re: Non-opaque hamt type?

2020-10-12 Thread Marc Nieper-Wißkirchen
One final issue (I hope): At the moment, the header file exposes an opaque struct Hamt and communication with the code happens through (stack-allocated) pointers to a Hamt. In the implementation, however, each Hamt just consists of two pointers (a pointer to a function table and a pointer to the