home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / modula3 / 1157 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.7 KB  |  45 lines

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