home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!oasys!roth
- From: roth@oasys.dt.navy.mil (Pete Roth)
- Newsgroups: comp.lang.pascal
- Subject: Re: Constant objects in TP 6.0
- Message-ID: <23036@oasys.dt.navy.mil>
- Date: 31 Jul 92 12:33:43 GMT
- References: <Bs7qyv.KK3@knot.ccs.queensu.ca>
- Reply-To: roth@oasys.dt.navy.mil (Pete Roth)
- Organization: The David Taylor Model Basin
- Lines: 52
-
- Newsgroups: comp.lang.pascal
- Subject: Re: Constant objects in TP 6.0
- Expires:
- References: <Bs7qyv.KK3@knot.ccs.queensu.ca>
- Reply-To: roth@oasys.dt.navy.mil (Pete Roth)
- Followup-To:
- Organization: The David Taylor Model Basin
-
- In comp.lang.pascal, dmurdoch@QueensU.CA (Duncan Murdoch) writes:
- >I've just discovered a problem (I'm not sure if I'd call it a bug, but a
- >design inconsistency) in Turbo Pascal 6.0's handling of constant objects.
-
- [ "bug" description deleted ]
-
- >I'd suggest the following alternative syntax for constant objects:
- >
- >const { corrected }
- > descend : TDescend.Init(...);
- >
- >where Init is a constructor. This would be executed just before the
- >initialization section of the unit it occured in. The constructor could
- >set any private fields and generally initialize the object properly.
-
- But isn't that what the "unit initialization section" is all about?
- Such being the case, the declaration should be
-
- UNIT unitname ;
- INTERFACE
- USES whatever;
-
- VAR { <- much preferred, since the object will most likely change }
- descend : TDescend;
-
- IMPLEMENTATION
- { etc. }
-
- BEGIN
- descend.Init(...) ;
- END .
-
- So far the only reason for "constant" objects that I can think of
- is the "initialization". What else would you use them for ?
-
- regards, pete
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- Peter N Roth roth@oasys.dt.navy.mil
- "Never argue with someone who buys ink by the barrel." - Daniel Janal.
-
- regards, pete
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- Peter N Roth roth@oasys.dt.navy.mil
- "Never argue with someone who buys ink by the barrel." - Daniel Janal.
-