Article View: comp.lang.modula2
Article #1556Re: multiple implementations
From: Tim Channon
Date: Tue, 13 Oct 1992 19:44
Date: Tue, 13 Oct 1992 19:44
25 lines
1274 bytes
1274 bytes
> Nah, you can do it with straight Modula-2 and a bit of indirection. I
> wrote an IBM technical report on this but I don't know if they are
> available externally.
So you can but was this the question?
> DEFINITION MODULE Stack;
> TYPE
> T (*Opaque*);
> PROCEDURE Push (stack: T;
> item: CARDINAL);
> PROCEDURE Pop (stack: T): CARDINAL;
> END Stack;
That is dangerous. Push(thing); would be ok and hides whatever is going on in
the stack module.
Is the bottom line a need for OOP? Throw something at the stack and let it
sort it out but runtime or compiletime?
You have shown a runtime solution, now show a compiletime solution. :-)
TC.
E-mail: tchannon@black.demon.co.uk or tchannon@cix.compulink.co.uk
Technical Details
Message-ID:
<719030690snx@black.demon.co.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!pipex!demon!black.demon.co.uk!tchannonReferences:
<1992Oct12.200703.11026@rchland.ibm.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.modula2 From: tchannon@black.demon.co.uk (Tim Channon) Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!demon!black.demon.co.uk!tchannon ReplyTo: tchannon@black.demon.co.uk Subject: Re: multiple implementations References: <1992Oct12.200703.11026@rchland.ibm.com> Distribution: world X-Mailer: cppnews $Revision: 1.18 $ Organization: null Lines: 24 Date: Tue, 13 Oct 1992 19:44:50 +0000 Message-ID: <719030690snx@black.demon.co.uk> Sender: usenet@gate.demon.co.uk