<div dir="ltr"><div dir="ltr">Couldn't it check whether there has been resize in between and avoid the second lookup if there hasn't been one?</div><div dir="ltr"><br></div><div>-- vyzo<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 26, 2019 at 11:31 PM Marc Feeley <<a href="mailto:feeley@iro.umontreal.ca">feeley@iro.umontreal.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I’m currently reimplementing tables, so it is a good time to consider this.<br>
<br>
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.<br>
<br>
Marc<br>
<br>
<br>
<br>
> On Oct 26, 2019, at 12:45 PM, Dimitris Vyzovitis <<a href="mailto:vyzo@hackzen.org" target="_blank">vyzo@hackzen.org</a>> wrote:<br>
> <br>
> Marc,<br>
> <br>
> Can we add a table-update! primitive? <br>
> 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.<br>
> 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.<br>
> <br>
> -- vyzo<br>
<br>
<br>
</blockquote></div></div>