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

  1. Newsgroups: comp.lang.modula2
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!ira.uka.de!math.fu-berlin.de!news.belwue.de!theorie!titania.mathematik.uni-ulm.de!borchert
  3. From: borchert@titania.mathematik.uni-ulm.de (Andreas Borchert)
  4. Subject: Re: Oberon vs Modula-2
  5. Message-ID: <1992Nov20.131039.1764@informatik.uni-ulm.de>
  6. Sender: usenet@informatik.uni-ulm.de (Name for nntp-posting)
  7. Nntp-Posting-Host: titania.mathematik.uni-ulm.de
  8. Organization: University of Ulm, SAI
  9. References: <1992Nov13.130852.22775@jyu.fi> <1992Nov16.080647.26783@informatik.uni-ulm.de> <1992Nov17.155855.4413@let.rug.nl> <1992Nov19.104407.338@jyu.fi>
  10. Date: Fri, 20 Nov 92 13:10:39 GMT
  11. Lines: 28
  12.  
  13. In article <1992Nov19.104407.338@jyu.fi>, sakkinen@jyu.fi (Markku Sakkinen) writes:
  14. > Fortran, I think, has a rule stating that if a formal parameter is
  15. > modified within a subprogram, the corresponding actual parameter must
  16. > not be the same as any other actual parameter in the call.
  17. > Does Modula-2 or Oberon have a similar rule?  (Value parameters need
  18. > not be considered, but constant parameters would if passed by reference.)
  19.  
  20. I'm not familiar with Fortran but neither Modula-2 nor Oberon have
  21. a rule which forbid to pass the same actual parameter to two or more
  22. parameters, i.e.
  23.  
  24.    PROCEDURE p(VAR x, y: INTEGER); BEGIN ... END p;
  25.    (* ... *)
  26.    p(i, i);
  27.  
  28. is legal.
  29.  
  30. > Of course, those breaches of the rule that cannot be detected at compile
  31. > time could be too expensive to catch at run time.
  32.  
  33. That's the problem and I still don't see a better solution by
  34. use of constant attributes for parameters.
  35.  
  36. -- 
  37. _______________________________________________________________________________
  38.  
  39. Andreas Borchert, University of Ulm, SAI, D-W-7900 Ulm, Germany
  40. Internet: borchert@mathematik.uni-ulm.de
  41.