home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / pascal / 5314 < prev    next >
Encoding:
Text File  |  1992-09-10  |  1.7 KB  |  37 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!cs.utexas.edu!torn!news.ccs.queensu.ca!slip207.telnet1.QueensU.CA!dmurdoch
  3. From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
  4. Subject: Re: TP units question
  5. Message-ID: <dmurdoch.69.716176734@mast.queensu.ca>
  6. Lines: 25
  7. Sender: news@knot.ccs.queensu.ca (Netnews control)
  8. Organization: Queen's University
  9. References: <1992Sep4.141203.28370@news.columbia.edu> <ART.92Sep10133100@world.std.com>
  10. Date: Fri, 11 Sep 1992 01:58:55 GMT
  11.  
  12. In article <ART.92Sep10133100@world.std.com> art@world.std.com (Al Thompson) writes:
  13. >
  14. >No you don't.  The only place the parameter list must appear is the
  15. >interface section.  The occurence of the parameter list in the
  16. >implementation section is optional in TP and not permitted in Extended
  17. >Standard Pascal.  I usually include the parameter list inside a comment
  18. >in the implementation section.  This serves as a reminder as to what the
  19. >parameters are without requiring my going back and forth between the
  20. >interface and implementations, a real pain in a large program.These
  21. >remarks of course only apply to exported procedures.
  22.  
  23. That sounds like a bad flaw in the Extended Standard.  Without the compiler 
  24. checking up on you, how do you know that the parameter list you put in the 
  25. implementation section is really correct?  
  26.  
  27. There are some differences that compile equally well either way, but 
  28. lead to logic errors if you get them wrong:  For instance, your comment may 
  29. say a parameter is passed by value.  If the true declaration says that it's 
  30. passed by reference (a var parameter), then you may be modifying the 
  31. original when you think you've got a copy to work on.
  32.  
  33. I think the TP design is better here.
  34.  
  35. Duncan Murdoch
  36. dmurdoch@mast.queensu.ca
  37.