Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!rpi!bu.edu!orc!inews!iwarp.intel.com!ogicse!zephyr.ens.tek.com!tektronix!nosun!qiclab!m2xenix!puddle!p101.f4.n494.z5.fidonet.org!Pat.Terry From: Pat.Terry@p101.f4.n494.z5.fidonet.org (Pat Terry) Newsgroups: comp.lang.modula2 Subject: Re: Implementing Abstract Lists Message-ID: <459.26C1B329@puddle.fidonet.org> Date: 9 Aug 90 21:43:56 GMT Sender: ufgate@puddle.fidonet.org (newsout1.26) Organization: FidoNet node 5:494/4.101 - Settler City Fido, Grahamstown RSA Lines: 32 > Umm, gee, Dave, maybe I'm missing the point, here, but isn't this where a > variant record would come in real handy? As in > > TYPE > ThingType = ( aThing, anotherThing, lastThing ) ; > ItemType = RECORD > CASE ThingType OF > aThing: > fields for a thing > | > anotherThing: > fields for another thing > | > lastThing: > fields for last thing > END (* case *) > END ; > > Maybe I just misunderstood your problem, but using the above definition, > one copy of the "List" module would handle three widely different types of > things. Um, gee. But if you wanted to add a few more things you'd have to rewrite the CASE variants statement and recompile lots and lots, maybe. And change the CASE statements that would litter the code too. -- uucp: uunet!m2xenix!puddle!5!494!4.101!Pat.Terry Internet: Pat.Terry@p101.f4.n494.z5.fidonet.org