Lists, ArgLists, Functors. I have been considering a new form for lists. Because of the bugs in the current list stuff (reference counting is buggy) and that the most common operation on a list is cdr(), I have decided that a change to the list structure might be in order. This would also allow no CArg's to be reference counted, if Functors were changed as well. This would simplify things significantly for CArg's, and probably speed things up as well. From flisakow Wed Jan 3 17:48:40 1996 To: raghu@cs Date: Wed, 3 Jan 1996 17:48:40 -0600 (CST) I added the "sort" option to write_table, I was going to look through the other commands for I/O and see if any others would benefit from its use as well. I only did a fast hack to add it in, so the relation to be sorted must already exist (not a derived relation), I think this would be good enough for most uses, as the := operator can be used in the other cases. The big speedup that was gained from string reference counting has made me reconsider some of the earlier decisions I made about CArg. The major thing I'm unhappy with is how I did the reference counting for functors and lists. Basically, the way it is now is slowing down all the deletion of any type of CArg with an extra function call (to destroy, which usually calls delete). My plan is to push the reference-counting down a level, (to ArgList for Functors) and redesigning the list type to work with this more closely. Examining the operations most heavily performed on lists (in Unify) makes it apparent that "cdr" is the most important one. My plan (mostly implemented, but still being debugged) is to change the list structure to be: CArg: length of this list pointer to list data The list data will be stored backwards in a CArgStack (a dynamic array that is what the parser uses while reading in arglists and lists). This item is what will be reference counted. A quick example would probably illuminate what I'm trying to say. Suppose we have a list, [1,2,3] and have obtained its cdr, [2,3]: [1,2,3]: CArg (list-type, length 4, "mylist data") [2,3]: CArg (list-type, length 3, "mylist data") mylist data: (nil, 3, 2, 1) (with a reference count of 2) Shaun -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Shaun Flisakowski Associate Researcher / Coral DB Programmer flisakow@cs.wisc.edu Computer Science Dept, UW-Madison Occam's razor is so sharp - I bought the whole argument. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~