home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / modula2 / 1382 < prev    next >
Encoding:
Text File  |  1992-11-13  |  2.0 KB  |  41 lines

  1. Newsgroups: comp.lang.modula2
  2. Path: sparky!uunet!mcsun!news.funet.fi!network.jyu.fi!sakkinen
  3. From: sakkinen@jyu.fi (Markku Sakkinen)
  4. Subject: Re: mail delivery error
  5. Message-ID: <1992Nov13.082328.7329@jyu.fi>
  6. Organization: University of Jyvaskyla, Finland
  7. References: <5897@balrog.ctron.com> <1992Nov11.102409.12183@jyu.fi> <1992Nov11.134940.19557@titan.tsd.arlut.utexas.edu>
  8. Date: Fri, 13 Nov 1992 08:23:28 GMT
  9. Lines: 30
  10.  
  11. In article <1992Nov11.134940.19557@titan.tsd.arlut.utexas.edu> larry@tsd.arlut.utexas.edu (Larry Maturo) writes:
  12. >In article <1992Nov11.102409.12183@jyu.fi> sakkinen@jyu.fi (Markku Sakkinen) writes:
  13. >> ...
  14. >>That has obviously been the main reason for eliminating enumerations.
  15. >>And even this rationale is very weak.  Only record types can be extended
  16. >>in Oberon, not atomic types nor arrays.
  17. >>
  18. >Enumerations are often used as the discriminent in variant records.  In Oberon
  19. >you declare different records that are extensions of a common record.  You also
  20. >delcare a different pointer type to each one and the type name of the pointer
  21. >takes the place of the enumeration so you get the effect of enumerations, but
  22. >it's extendable over module boundries.  Pretty neat!
  23.  
  24. That's only one of the many useful purposes of enumerations!
  25. Furthermore, Oberon's type extensions cannot do all the things
  26. that are possible with tagged variant records (and vice versa).
  27. With variant records, you can change the variant of the object itself.
  28. With type extensions, you can only make a pointer point at an object
  29. of another related type:  that does not affect the original object
  30. nor any other pointers to it.
  31.  
  32. ----------------------------------------------------------------------
  33. Markku Sakkinen (sakkinen@jytko.jyu.fi)
  34.        SAKKINEN@FINJYU.bitnet (alternative network address)
  35. Department of Computer Science and Information Systems
  36. University of Jyvaskyla (a's with umlauts)
  37. PL 35
  38. SF-40351 Jyvaskyla (umlauts again)
  39. Finland
  40. ----------------------------------------------------------------------
  41.