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