John Darrington <[EMAIL PROTECTED]> writes: > On Tue, Jul 10, 2007 at 07:03:36AM -0700, Ben Pfaff wrote: > Second, in the datasheet > case we do want deletions and resizings, etc., to have an > immediate effect on each case_index, but not in many other > cases. For example if I read a system file dictionary with > sfm_open_reader, and delete some variables from that dictionary, > I don't want the dictionary's case_indexes to be adjusted because > the cases coming from the system file would then have their > variables in positions that I don't expect them to be in. > > I see. So unless we're going to somehow make the dictionary aware of > the capabilities of the data source with which it's associated (which > sounds like a nightmare to me) then we have to compromise. However, > there may other advantages to keeping the case indices monotonic with > respect to the dict indices, and accepting the O(n) overhead of > dict_compact_values (or dict_pad_values) with every > insertion/deletion.
I think that's the right tradeoff. dict_compact_values is sort of expensive, but it only occurs very infrequently (when the user changes a variable's width or adds or deletes a variable or moves one around) and I really can't imagine it being a bottleneck. -- "The sound of peacocks being shredded can't possibly be any worse than the sound of peacocks not being shredded." Tanuki the Raccoon-dog in the Monastery _______________________________________________ pspp-dev mailing list [email protected] http://lists.gnu.org/mailman/listinfo/pspp-dev
