[gambit-list] table-update! primitive

Dimitris Vyzovitis vyzo at hackzen.org
Sat Oct 26 16:34:37 EDT 2019


Couldn't it check whether there has been resize in between and avoid the
second lookup if there hasn't been one?

-- vyzo

On Sat, Oct 26, 2019 at 11:31 PM Marc Feeley <feeley at iro.umontreal.ca>
wrote:

> I’m currently reimplementing tables, so it is a good time to consider this.
>
> However, the “obvious” implementation which does one lookup will not work
> because the update procedure may cause the gc hash table to be resized.  So
> a lookup must be done before and after the update procedure is executed.
> However it is possible to avoid repeating some type checks.
>
> Marc
>
>
>
> > On Oct 26, 2019, at 12:45 PM, Dimitris Vyzovitis <vyzo at hackzen.org>
> wrote:
> >
> > Marc,
> >
> > Can we add a table-update! primitive?
> > Updates are currently slow because they need two lookups in the hash
> table, one to find the current value (if any) and one to set it.
> > The canonical signature is (table-update! table key update default),
> where update is applied to the current value, using default if the value is
> unset.
> >
> > -- vyzo
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20191026/bb0b340d/attachment.htm>


More information about the Gambit-list mailing list