Re: modifying array access syntax



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.
.



Relevant Pages

  • Re: transport a C pointer through Tcl
    ... Andreas Otto wrote: ... I've taken a different approach lately with extension pointers. ... In other words I store an int offset in each Tcl_Obj, ... It's also faster than Tcl's hash table, ...
    (comp.lang.tcl)
  • Re: Suggestions for double-hashing scheme
    ... > The items that are being moved are the items in the hash table itself, ... The hash table array would store, eg, a pointer to the memory ... on allocating enough space to store data elements of any size. ... Additionally storing pointers to them would make me incur the charge twice. ...
    (comp.programming)
  • Re: Suggestions for double-hashing scheme
    ... assuming pointers are the values being ... If we wanted to do an in-place move in the hash, ... itself, which are of fixed size (they are in an array, after all). ...
    (comp.programming)
  • Re: Setting up email on my FC1
    ... Hash: SHA1 ... > know of any pointers to getting started? ... Automatic actions for USB cameras, cardreaders, memory sticks, MP3 players ...
    (Fedora)
  • Re: "The Little Lisper"
    ... Regarding the Boehm GC: ... I was storing lots of hash ... codes interleaved with pointers and fillng memory, ... The data structure was redesigned so that we ...
    (comp.lang.lisp)