[comp.lang.pascal] TP Units

pattis@cs.washington.edu (Richard Pattis) (08/02/90)

I am trying to write a paper comparing TP Units to Modula-2 Modules to
Ada Pacakges.  I'm familiar with the later two, but not Units.

1) Are there any published comparisions of these language features?

2) Is there a good book chapter someone can recommend to bring me up to speed
on TP Units?

Rich Pattis

s882023@minyos.xx.rmit.oz.au (Andy P [PB]) (06/09/91)

Could someone please tell me how
compatible Turbo pascal 5.5 units are with TP-6 ...
also TP5.0 any (dos) versions really ..


thanx in advance..

-------------------------------------------------------------------------------
 AndyP 	 - email s882023@minyos.xx.rmit.oz.au                 Chillin'
                 s882023@yallara.cs.rmit.oz.au
-------------------------------------------------------------------------------
 Nth Melbourne Giants - Collingwood - UNLV - Chicago Bulls - Green Bay Packers
-------------------------------------------------------------------------------

dmurdoch@watstat.waterloo.edu (Duncan Murdoch) (06/10/91)

In article <1991Jun9.150801.5178@minyos.xx.rmit.oz.au> s882023@minyos.xx.rmit.oz.au (Andy P [PB]) writes:
>Could someone please tell me how
>compatible Turbo pascal 5.5 units are with TP-6 ...
>also TP5.0 any (dos) versions really ..

The compiled units (i.e. .TPU files) are not compatible at all between
different versions of the System unit.  Every release of TP so far has had
a new system unit, and all but the last (TPW) had a new .TPU format as well.

If you have source code, things aren't so bad.  The changes from 4 to 5 and
5.5 probably won't cause you any trouble.  You'll only have trouble going
to 6.0 if
 - you have buggy code:  6.0 is less forgiving.  It requires that 
   assembler routines clean up the stack properly, and that you never
   try to dereference a pointer after you've disposed of it.
 - you have code that depends on the working of the heap manager.  It's
   quite different, so that'll have to be rewritten.  You're almost sure
   to get a compile-time error if this is the case, because Borland changed
   the names of some variables when their implementation changed.

Duncan Murdoch
dmurdoch@watstat.waterloo.edu

bns@ersys.edmonton.ab.ca (Chris Dollmont) (06/11/91)

s882023@minyos.xx.rmit.oz.au (Andy P [PB]) writes:

> Could someone please tell me how
> compatible Turbo pascal 5.5 units are with TP-6 ...
> also TP5.0 any (dos) versions really ..
> 
There are a couple of minor differences between TP 5.x and 6.0.  If you 
have the source for your units, they should re-compile under 6.0 without 
too much difficulty.  If you do not have the source, you will be unable 
to use the 5.x units with 6.0.

I'm I the only one that is upset by the fact that Borland keeps changing 
the unit structure so I have to upgrade EVERYTHING, not just my TP??

Chris

Chris Dollmont              bns@ersys.edmonton.ab.ca
Edmonton Remote Systems:  Serving Northern Alberta since 1982

dmurdoch@watstat.waterloo.edu (Duncan Murdoch) (06/11/91)

In article <60Bc41w164w@ersys.edmonton.ab.ca> bns@ersys.edmonton.ab.ca (Chris Dollmont) writes:
>
>I'm I the only one that is upset by the fact that Borland keeps changing 
>the unit structure so I have to upgrade EVERYTHING, not just my TP??

I think you've got it backwards.  Borland keeps changing the unit structure,
because all of your .TPU files would be useless anyways.  Every time a change
is made to the interface of a unit, anything that uses it has to be 
recompiled.  I can't imagine a new version of TP that wouldn't have changes
to the SYSTEM unit, let alone the other standard units.  

For example:  TP6 and TPW 1.0 have identical .TPU formats, but of course
a .TPU file from one is useless in the other.

You're right to complain about this, but you can protect yourself
against it in two ways.  The way I do it is to never, ever, rely on a unit
unless I have the source code.  (Actually, external routines in an .OBJ
file are reasonably safe.)  If I have the source code, I'm confident that
I'll be able to recompile it in a new version (though I may need to make
some changes).  If I don't, I rely on the good will and success at remaining
solvent of the supplier of the unit.

The other way to protect yourself is just not to upgrade TP.  If a lot of
people chose this option, Borland might get the message.

By the way, it now looks possible to get cut off in the same way in C as
well as TP.  I'd bet that the precompiled header files that Borland's
recently introduced there are as version specific as .TPU files; we'll see
if anyone starts distributing .OBJ+precompiled headers now that it's 
possible.

Duncan Murdoch
dmurdoch@watstat.waterloo.edu

bns@ersys.edmonton.ab.ca (Chris Dollmont) (06/11/91)

I agree with your statement about relying on external units when you 
don't have source code, but there are some situations where this is not 
always possible.  Right now, we are only using one set of libraries that 
we do not have the source for, but it is a critical one for our 
development (Paradox Engine).

As for not upgrading TP -- it is not always possible to just ignore a lot 
of the new features.  I'd like to coast, but Borland usually puts enough 
new stuff into each release that I can't.
 
Chris

|  Chris Dollmont                   | USENET:  bns@ersys.edmonton.ab.ca
|  Blue North Software              |  Mail:    16936D 85th Ave.
|                                   |           Edmonton, AB T5R 4A3
|  These opinions remain valid only as long as they are visible...