Article View: comp.lang.modula2
Article #998Re: Implementing Abstract Lists
From: Vincent Manis
Date: Thu, 02 Aug 1990 01:11
Date: Thu, 02 Aug 1990 01:11
22 lines
1736 bytes
1736 bytes
Sorry, Modula-2 isn't really suitable for generic "container" ADT's such as List, Stack, Queue, etc. (i.e., all the stuff of computer science). There is a way to do it, namely by using ADDRESS values, and casting the actual parameters to type ADDRESS in calls to the ADT procedures, but it's a crock. Wirth has abandoned Modula. His new language, Oberon, provides garbage collection, and allows a limited form of structure inheritance. The result is that you can have a List module. You can then declare an IntegerList record type, inheriting from List. (Note that Oberon isn't object-oriented: inheritance affects fields, not methods.) The List procedures will work with IntegerLists with no problem. I switched from Modula-2 to C in my data structures course last year. Afterwards, I really felt that I had lost almost nothing. This isn't a compliment to C, but a criticism of Modula. It really doesn't help you very much with the tough problems. -- \ Vincent Manis <manis@cs.ubc.ca> "There is no law that vulgarity and \ Department of Computer Science literary excellence cannot coexist." /\ University of British Columbia -- A. Trevor Hodge / \ Vancouver, BC, Canada V6T 1W5 (604) 228-2394
Technical Details
Message-ID:
<8974@ubc-cs.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!wuarchive!mit-eddie!uw-beaver!ubc-cs!manisReferences:
<290@saxony.pa.reuter.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!wuarchive!mit-eddie!uw-beaver!ubc-cs!manis From: manis@cs.ubc.ca (Vincent Manis) Newsgroups: comp.lang.modula2,comp.edu Subject: Re: Implementing Abstract Lists Keywords: modula Message-ID: <8974@ubc-cs.UUCP> Date: 2 Aug 90 01:11:38 GMT References: <290@saxony.pa.reuter.COM> Sender: news@cs.ubc.ca Organization: Institute for Pure and Applied Eschatology Lines: 22