home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.modula3
- Path: sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watmath!undergrad.math.waterloo.edu!papresco
- From: papresco@undergrad.math.waterloo.edu (Paul Prescod)
- Subject: Re: references, objects & m3
- Message-ID: <C1Foyn.8Is@undergrad.math.waterloo.edu>
- Organization: University of Waterloo
- References: <MOSS.93Jan24164146@CRAFTY.cs.cmu.edu> <C1E30F.vx@undergrad.math.waterloo.edu> <FN00.93Jan25085601@tahoe.gte.com>
- Date: Mon, 25 Jan 1993 23:51:56 GMT
- Lines: 34
-
- >I wonder why do you need to copy objects.
-
- You are right, it's not that often. But occasionally you may want to
- have permission to edit an object without changing the original.
-
- Besides: Isn't the idea of object oriented programming that you
- shouldn't have to understand the implementation of the "primitives."
- If I didn't understand how M3 objects worked, I could very easily edit
- the original.
-
- Once you understand it, I guess it's just another convention.
-
- >Not really (except for static initializations). This is a matter of
- >religeous war among Modula-3 purists and people with C++ orientation.
- >I hope that I won't be starting a war-thread on this subject, when I
- >say that:
- >
- >- Because of garbage collection, destructors are not as crucial in
- > Modula-3 programming. (What do you usually do in a destructor in
- > C++?)
-
- Agreed. But what about say, sending a message to a window that has
- just been destroyed to remove itself from the screen. Is there a
- one line call-destructor and destroy object similar to your one line
- constructor?
-
- >- Constructor-like procedures can be created by doing:
-
- > VAR t := NEW (Foo.T).init(20);
-
- >Hope this helps.
-
- Immensely, thanks for the explanation.
-
-