Re: Minimal keywords needed for constructing a full CL system
- From: Pascal Bourguignon <pjb@xxxxxxxxxxxxxxxxx>
- Date: Mon, 17 Jul 2006 15:36:10 +0200
rpw3@xxxxxxxx (Rob Warnock) writes:
+---------------
| You don't need hash tables, but weak hash tables are very very handy,
| and I don't see how those could be implemented outside the core.
+---------------
Just curious... How are weak hash tables more useful than generic
weak pointers? [You need weak pointers for finalization, which I'll
grant can be useful.]
Some weak structures can be implemented above mere weak pointers, but
some other cannot. For example, weak-or-relation is primitive, you
cannot implement it with only weak-pointer.
Also, depending on the invariants you expect after a garbage
collection, you may need to implement the other weak structures as
primitives too.
For one thing, the unsuspecting garbage collector will collect only
the first layer of the weak pointer. The weak pointers that become
dead because of this first garbage collecting are not further
collected. So if you implement non primitive weak structures, you
need to run the garbage collector several times in a row to get the
same effect as with primitive weak structures. The situation is worse
with circular structures of weak pointer. As soon as it goes thru a
non weak structure such as a hash table (or merely a structure that
won't be normally garbage collected, because it's used), the weak
pointers won't die, and won't be collected. This is particularly true
with hash table, when the value contains a back reference to the weak
key: the weak key won't die, even if the only reference there is to it
comes from the value.
http://www.informatimago.com/develop/lisp/index.html#clext
Ad: The best weak structure support is in clisp!
--
__Pascal Bourguignon__ http://www.informatimago.com/
Kitty like plastic.
Confuses for litter box.
Don't leave tarp around.
.
- References:
- Minimal keywords needed for constructing a full CL system
- From: Javier
- Re: Minimal keywords needed for constructing a full CL system
- From: Rob Thorpe
- Re: Minimal keywords needed for constructing a full CL system
- From: Rob Warnock
- Re: Minimal keywords needed for constructing a full CL system
- From: Lars Brinkhoff
- Re: Minimal keywords needed for constructing a full CL system
- From: Rob Warnock
- Minimal keywords needed for constructing a full CL system
- Prev by Date: Re: AMOP example
- Next by Date: Re: Amazon used lisp & C exclusively?
- Previous by thread: Re: Minimal keywords needed for constructing a full CL system
- Next by thread: Re: Minimal keywords needed for constructing a full CL system
- Index(es):
Relevant Pages
|