🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #1060

Re: Implementing Abstract Lists

#1060
From: Pat Terry
Date: Thu, 09 Aug 1990 21:43
32 lines
1594 bytes
 > 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
Technical Details
Message-ID: <459.26C1B329@puddle.fidonet.org>
Path: arc1-ca.pugleaf.net!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

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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