How can I copy a hash-table in CommonLisp ?
(I know, I can make a brand-new hash-table and copy one element after the other,
but this is utterly inefficient since it requires rehashing what's already
hashed !)
Stefan
In article <··········@info.epfl.ch> "Stefan Monnier" <··············@lia.di.epfl.ch> writes:
> How can I copy a hash-table in CommonLisp ?
> (I know, I can make a brand-new hash-table and copy one element after the other,
> but this is utterly inefficient since it requires rehashing what's already
> hashed !)
I think maphash and constructing a new table is the only portable way. You
do know the size of the table so that helps a little. If this is a bottle
neck, maybe you can find a way to avoid copying it.