From: Jesse G. <je...@wi...> - 2004-09-11 21:53:35
|
Brian Hurt wrote: > On Fri, 10 Sep 2004, Jesse Guardiani wrote: > >> Actually, I tried this before I submitted the current implementation and >> I couldn't get it to work. The problem seemed to be that Dllist has no >> concept of Empty, so the length function becomes really difficult to >> implement. > > I moved the concept of "empty" one level up in my implementation. This is > because I didn't want to deal with options on the next/prev links. > >> >> Brian, do you think it's possible to implement enums without the "valid" >> test? If everyone thinks it's possible then I'll give it another shot. I >> just didn't have much luck the first time around. > > Actually, changing things so that x.next == x is the sign of the end of > the list should make enums easier. > > let rec enum_done = { data = Obj.magic (); next = enum_done; > prev = enum_done };; > > let enum dlst = > match dlst.head with The concept of "head" was removed along with the concept of "Empty" in the last release. -- Jesse Guardiani, Systems Administrator WingNET Internet Services, P.O. Box 2605 // Cleveland, TN 37320-2605 423-559-LINK (v) 423-559-5145 (f) http://www.wingnet.net |