Re: modifying array access syntax
- From: Kent M Pitman <pitman@xxxxxxxxxxx>
- Date: Thu, 15 Sep 2005 15:24:00 GMT
Pascal Bourguignon <spam@xxxxxxxxxxxxxxxx> writes:
> Ray Dillinger <bear@xxxxxxxxx> writes:
> > (note: I think I've decided that properties for symbols
> > are a win; symbols *should* be able to contain an arbitrary
> > set of named values. But I think the interface for it
> > should leave it possible for it to be implemented as a
> > hash table instead of a list, [...]
>
> You only need to shadow symbol-plist and get.
Well, as you implicitly noted in your code, you also need weak hash
tables to complete the illusion. So your use of "only" here depends
a great deal on the way in which you're using plists. Implicit in
the notion of plists is the subtle issue that the plists are garbage
collected if the pointers to the symbols are collected.
In an implementation that is absent weak hash tables, it's perhaps
safer to avoid the abstraction you suggest, and instead to make "hash
functions" (functions closed over a hash table that can do get/set
service operations on it) on a per-property basis, since you can drop
your pointer to the function (and the table) when you're done.
Statistically, if you have a pattern of ever dropping these hash
functions (and hence their tables), you will tend to sometimes at
least, not always, drop pointers to symbols that want to be collected.
.
- References:
- Re: modifying array access syntax
- From: Ray Dillinger
- Re: modifying array access syntax
- From: Pascal Bourguignon
- Re: modifying array access syntax
- Prev by Date: Re: New to Lisp: UFFI, CFFI, and osicat, oh my!
- Next by Date: Re: modifying array access syntax
- Previous by thread: Re: modifying array access syntax
- Next by thread: Re: modifying array access syntax
- Index(es):
Relevant Pages
|