guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GLOCs are going away.


From: Michael Livshin
Subject: Re: GLOCs are going away.
Date: 26 Jul 2001 20:45:37 +0300
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Copyleft)

Marius Vollmer <address@hidden> writes:

> Dirk Herrmann <address@hidden> writes:
> 
> > However, I just realized that we _could_ easily provide weak pairs:  
> > Since Michael has extracted the GC flags from the cells, bit #0 of a
> > pair's cdr is always 0 (it was used to store the mark bit for pairs during
> > gc).  This bit could be used to indicate weak pairs.
> 
> Interesting idea.  Is there something fundamental wrong with the
> current weak vectors and hashtables?

well, not as such.

one can make the case that given weak pairs and guardians you can
implement weak dictionaries in pure Scheme, thus not needing the
primitive support for weak vectors/hashes.

but:

if your dictionary implementation is vector-based (like the one in
Guile), then the current primitively-implemented weak hash tables are
better, since they have no memory overhead (compared to non-weak
ones).

if your dictionary implementation is different, then it's a different
story.

on an orthogonal (or not so orthogonal) note, the Common Lisp standard
specifies hash tables, but never says that they are vector-based.  and
since they tend to have "interesting" interactions with GCs
(especially copying ones), it's considered best to implement CL hash
tables primitively.

is there any interesting use for weak pairs besides implementing weak
dictionaries?

-- 
Nobody can fix the economy.  Nobody can be trusted with their finger on the
button.  Nobody's perfect.  VOTE FOR NOBODY.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]