home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / modula3 / 1143 < prev    next >
Encoding:
Internet Message Format  |  1993-01-24  |  1.9 KB

  1. Path: sparky!uunet!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!netnews-2.srv.cs.cmu.edu!moss
  2. From: moss@cs.cmu.edu (Eliot Moss)
  3. Newsgroups: comp.lang.modula3
  4. Subject: Re: references, objects & m3
  5. Message-ID: <MOSS.93Jan24164146@CRAFTY.cs.cmu.edu>
  6. Date: 24 Jan 93 21:41:46 GMT
  7. Article-I.D.: CRAFTY.MOSS.93Jan24164146
  8. References: <C1BsMI.5Ay@undergrad.math.waterloo.edu>
  9. Sender: news@cs.cmu.edu (Usenet News System)
  10. Reply-To: moss@cs.cmu.edu
  11. Organization: Dept of Comp and Info Sci, Univ of Mass (Amherst)
  12. Lines: 26
  13. In-Reply-To: papresco@napier.uwaterloo.ca's message of 23 Jan 93 21:20:41 GMT
  14. Nntp-Posting-Host: crafty.fox.cs.cmu.edu
  15.  
  16. I don't understand why you're using REF OBJECT ... END instead of just OBJECT
  17. ... END. The latter is implementation essentially as REF RECORD ... END, but
  18. with the additional semantics of OBJECT method invocation, subtyping, etc. You
  19. should probably just delete the level of REF in your binary tree stuff. Maybe
  20. you want somehting like this:
  21.  
  22.     TYPE Node = RECORD
  23.                   This       : Sortable;
  24.               Left, Right: REF Node;
  25.             END;
  26.  
  27. You are quite right in noting that REF S is not a subtype of REF T, even when
  28. S is a subtype of T. Adding such subtyping rules to the language has various
  29. undesirable consequences, mainly in complexity, though one may be able to come
  30. up with type systems in which such subtyping judgements would be sound. See
  31. the section of the Nelson book "How the Language Got Its Spots" for further
  32. discussion of rationale for the subtyping rules.
  33. --
  34.  
  35. J. Eliot B. Moss, Associate Professor    Visiting Associate Professor
  36. Department of Computer Science        School of Computer Science
  37. Lederle Graduate Research Center    Carnegie Mellon University
  38. University of Massachusetts        5000 Forbes Avenue
  39. Amherst, MA  01003            Pittsburgh, PA  15213-3891
  40. (413) 545-4206, 545-1249 (fax)        (412) 268-6767, 681-5739 (fax)
  41. Moss@cs.umass.edu            Moss@cs.cmu.edu
  42.