home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / modula2 / 1406 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.4 KB  |  27 lines

  1. Newsgroups: comp.lang.modula2
  2. Path: sparky!uunet!mcsun!sun4nl!freya.let.rug.nl!bert
  3. From: bert@let.rug.nl (Bert Bos)
  4. Subject: Re: Oberon vs Modula-2 (Re: mail delivery error)
  5. Message-ID: <1992Nov17.155855.4413@let.rug.nl>
  6. Sender: news@let.rug.nl (news manager)
  7. Nntp-Posting-Host: tyr.let.rug.nl
  8. Organization: Faculteit der Letteren, Rijksuniversiteit Groningen, NL
  9. References: <5897@balrog.ctron.com> <1992Nov11.102409.12183@jyu.fi> <1992Nov13.100154.6167@informatik.uni-ulm.de> <1992Nov13.130852.22775@jyu.fi> <1992Nov16.080647.26783@informatik.uni-ulm.de>
  10. Date: Tue, 17 Nov 1992 15:58:55 GMT
  11. Lines: 14
  12.  
  13. In article <1992Nov16.080647.26783@informatik.uni-ulm.de>, borchert@titania.mathematik.uni-ulm.de (Andreas Borchert) writes:
  14. > Agreed, programmers shouldn't be enforced to use VAR-parameters
  15. > for reasons of efficiency only. But, even with the semantics of
  16. > Oberon or Modula-2, it's not to difficult for the compiler to
  17. > detect that your 1000 x 1000 array isn't modified and, thus,
  18. > doesn't need to be copied.
  19. > Usually, the calling procedure passes a reference to the array onto
  20. > the stack in both cases and the called procedure then makes a copy
  21. > of the array if you have call-by-value and your array parameter
  22. > is subject to changes.
  23.  
  24. But what about a PROCEDURE p(a: Type; VAR b: Type) that is called as p(x, x). Both parameters will refer to x, but if b is modified, a should remain unchanged.
  25.  
  26.