Guile Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scheme style auto-resizing hashtable (fwd)
> > My table-remove! and index-remove! have optional arguments, if you
> > only supply one argument (the table) they delete everything, as you
> > supply more args they get more selective. I'm still wondering if this
> > use for optional arguments is clever or just confusing.
> sounds a bit dangerous, consider
> (apply dictionary-clear! lst)
> the user means for "lst" to be (my-dictionary #t) or whatever, but
> mistakenly has it set to just (my-dictionary)
Hmmm, I see justice in this argument, so blah-remove! should take out
just a single item and blah-clear! should take out all items.
> here's a new list of dictionary procedures
> behavior modifiers:
> the big three basic operations:
> iterators and friends:
> dictionary-map <-> ???
> dictionary-foreach <-> ???
> dictionary-make-iterator -- perhaps add an "auto-grow"
> -- option to be toggled off until
> -- iterator is finished
> dictionary to whatever conversions:
> dictionary->alist -- was dictionary->items
> whatever to dictionary "conversions":
> dictionary-consume-alist! -- delete alist while
> -- inserting pairs (to conserve memory)
> dictionary-consume-dictionary! -- delete buckets while
> -- inserting entries
> the rest:
These all look pretty good to me.
Just a very fanciful suggestion: Is it possible to combine
``dictionary-insert-alist!'' and ``dictionary-insert-dictionary!''
into ``dictionary-insert!'' such that (dictionary-inset! D fred)
will look at the type of fred and modify it's behaviour accordingly?
Am I getting carried away here? Is someone likely to want a dictionary
I like the idea of the consumers, it should be a big saving on garbage
Guile Home |
Main Index |