[fa.info-mac] Macintosh Pascal, Some Highlights.

info-mac@uw-beaver (info-mac) (10/09/84)

From: "David H M Spector" <SPECTOR@NYU-CMCL1.ARPA>
As promised, here are some of the highlights of Macintosh Pascal.
Most of the following is taken from the Macintosh Pascal Technical Appendix,
which is supplied with the system.

----------------------------------------------------------------------------

The Macintosh Pascal system package contains the following:

	2 Macintosh Pascal System disks, COPY PROTECTED.
	1 Macintosh Pascal User's Guide.
	1 Macintosh Pascal Reference Guide.
	1 Macintosh Pascal Technical Appendix.

The two systems disks are identical, they contain a complete FINDER, with
the minimal font set, the SYSTEM file and IMAGEWRITER.  MacPascal itself
occupies a 117Kb file, and contains Pascal, and all the libraries (more on this
later), stored as resources.  
There are a number of folders containing all sorts of nifty stuff.

	Info Folder:
		Contains an Errata file, some hints, and misc. stuff on
		working with Pascal

	Tools Folder:
    	o	Contains an editor (in MacPascal) that is very close to being
		Cary Clark's FILE program. This *CAN* be used to edit your 
		programs, although this can be done from Pascal itself.
	
	o	A file called BROWSER (also in Pascal), which lets you 
		browse through files, its sort of like ''more''.

	o	A utility that called something like printfile, that lets
		you print and arbitryay text file.

	Demos Folder:

	This folder contains may slick demos, which I won't describe (save one)
	as this would kill half of your fun when you get Pascal..

	The one demo to take a close look at is called FLAG, and shows you
	just how fast quickdraw REALLY is.  I'll say this, it moves soooo
	fast, you'll see ''snow'' on your Macintosh's screen.

Now, more on Pascal ITSELF:

According to the manual (Technical Appendix),....

"Macintosh Pascal complies with the requirements of ANSI/IEEE770x3.97-1983,
with the following exceptions:

	o In ANS Pascal, the special symbol @ is an alternative representation
	  for the special symbol ^, and is required to be treated identically
	  to ^ wherever it appears.  In Macintosh Pascal the special symbol @
	  is an operation and never treated identicall to ^.

	o In ANS Pascal,identifiers may be of any length and all characters are
	  significant.  In Macintosh Pascal, all characters are in identifiers
  	  are significant, but the largest identifier is restricted to 255
	  characters.

	o In ANS Pascal, a character-string of length 1 is a char-type value
	  and a character-string of length n is a value of packed-string-type
	  (a PACKED ARRAY [1..n] of CHAR -- referred to as a string-type in ANS
	  PASCAL) with n components.  In Macintosh Pascal, all quoted character
	  strings are string-type values.  However, the compatibility and
	  assignment-compatibility rules in Macintosh Pascal make its behaviour
	  with respect to character-strings compatible with ANS Pascal.

	o In ANS Pascal, no statements that THREATEN the values of a control
	  variable of a for-statement are allowed.  In Macintosh Pascal,
	  this restriction is not as severe:  no statement  may ALTER the value
	  of the control variable of a for-statement while the for-statement
	  is executing.

	o In Macintosh Pascal, only the standard file variable INPUT and OUTPUT
	  are allowed as program parameters."


The following are SOME of the extensions to ANSI Pascal, (the list is two pages
long...):

	o The following are reserved words in Macintosh Pascal:
	
	   uses - calls in libraries.
	   otherwise - the drop through clause of a case-statement.
	   string - String type.

	o  An identifier may have an underscore anywhere following the initial
	   letter of the identifier.

	o  Macintosh Pascal supports the additional integer-type LONGINT and
	   the additional real-types DOUBLE, EXTENDED and COMPUTATIONAL.
	   (The latter are for use mainly with the interface to SANE -dhms)

	

For the most part, Macintosh Pascal is compatible with LsaPascal, the
restrinctions are mostly on LisaSpecific things, and to fix incompat-
ibilities with ANS Pascal and bugs/quirks in LisaPascal.

Now for the really Cool stuff.

The rest of the Macintosh Pascal Technical Appendix is dedicated to the
QUICKDRAW and SANE Libraries.  The Sane and Quickdraw manuals are here, from
what I can tell, in their entirety.  There are complete indstructions on 
how to call/use/abuse these libraries from pascal, etc.

One of the best features of all in Macintosh Pascal, is its ability to
call toolbox routines directly.  There is an "inlines" feature which
lests you define a toolbox trap, and then you can call it as you would
from assembly.  There are big, boldfaced caveats about using these though,
as all of Pascal checking (etc) are turned off when you do this.  I think
that they really want you to use them, as the demo editor is written
entirely with them.  This editor created its OWN menubars with them, etc, etc.

When editing a program in pascal itself, all sorts of neat things happen.
When you end a statement, by entering a semicolon, it is instantly parsed, all
reserved words are highlighted, and the Mac lets you know if it found any 
mistakes ( it keeps quiet if none were found).  You can invoke the syntax 
checker from the menu bar, and it will give you a thumbs down icon when it
finds bogus code.  There is a facility for inserting little stop signs wherever
yuo want to put breakpoints.  There is also a GREAT menu selection that 
lets you watch variables change and another, called INSTANT..., that lets you
execute a statement "instantly".

One of the really cute things, that give you an idea of how much work the
folks at Apple & Think Tech. put into this is, that when entering comments,
if you hit a RETURN, with out closing the comment on that line, the Mac
will supply the closing curly-bracket, making for block structured comments.
Code is also indents for you to the apporp. levels.  

My first impressions are good, its a good, pretty fast system.
Its is a great learning tool, and the fact that its mostly compatible with 
Lisa Pascal, is noce so you can use a local lisa to write ""real"" 
applications.


Well, that's a short overview.....if any one has really specific questions,
I'll try and answer them, and if enough intertest I'll post a summary to 
the net.

			David.
		NYU/acf Systems Group
		Spector@nyu-cmcl1.ARPA
 
-------