[comp.sys.mac.programmer] MPW Pascal precompilation

tim@hoptoad.uucp (Tim Maroney) (10/03/90)

I've started doing some work in MPW Pascal, and I was wondering how I
should manage the strange header-precompilation scheme.  It seems as if
the only way to avoid constant rebuilding of the headers (as shown by
the Pascal progress information) is to always include exactly the same
files in exactly the same order.  This is obviously impossible for any
project of significant size and circular reference.

What's more, because of build-order considerations, sometimes a file
will not compile because of missing units, whereas it did build earlier
provided it came after another file whose unit list somewhow caused the
missing unit to be included in another file's precompiled header.

How do others deal with optimizing the precompiled headers?
-- 
Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com

"He goes on about the wailing and gnashing of teeth.  It comes in one
 verse after another, and it is quite manifest to the reader that there
 is a certain pleasure in contemplating the wailing and gnashing of
 teeth, or else it would not occur so often."
	-- Bertrand Russell, "Why I Am Not a Christian"

urlichs@smurf.sub.org (Matthias Urlichs) (10/14/90)

In comp.sys.mac.programmer, article <12631@hoptoad.uucp>,
  tim@hoptoad.uucp (Tim Maroney) writes:

< [ MPW Pascal precompiled header usage problem ]
< 
< What's more, because of build-order considerations, sometimes a file
< will not compile because of missing units, whereas it did build earlier
< provided it came after another file whose unit list somewhow caused the
< missing unit to be included in another file's precompiled header.

What a sentence. ;-)
< 
< How do others deal with optimizing the precompiled headers?

I am using four (actually five) different schemes, depending on project
complexity and header interrelatedness (in order of increasing project
complexity and/or stuckness with a particular difficult problem):

- Include (via $include) everything in "Everything.p", and put "Uses
  Everything" into every Pascal file.
- Use different symbol folders, with the "-k :sysX:" option.
- Use Norbert Lindenberg's MakeUses tool, which can generate exhaustive 
  USES statements and Makefile lines for your Pascal source code.
  I'll ask him about availability. DON'T ASK ME FOR THIS (YET).
- Rethink your code layout. In a properly thought-out hierarchy, this should
  not happen. 
  I admit it would be a very big help if whoever wrote the MPW Pascal
  compiler had heard  about dynamic memory allocation, and used it for the
  inclusion of files and the depth of $IF directives, so that we migght be
  able to use MPW's inclusion techniques in our own project.
- Use Modula 2. The p1 compiler is pretty good, Modula has version checking
  between declaration and implementation, you can be more flexible /
  selective in what you include... -- in other words, the problem goes away.
  It even has object-oriented extensions, and works with MacApp quite well.

-- 
Matthias Urlichs -- urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de     /(o\
Humboldtstrasse 7 - 7500 Karlsruhe 1 - FRG -- +49+721+621127(0700-2330)   \o)/