ADC Home > Reference Library > Technical Notes > Legacy Documents > Tools >
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
|
IntroductionMPW Pascal converts SINGLE numbers to extendedDate Written: 1/22/91 Last reviewed: 6/14/93 Why does MPW Pascal convert SINGLE numbers to extended, create a temporary area for them, and then pass a pointer to those extended numbers on the stack? The conversion of single-precision values to extended is being done to maintain accuracy. It's entirely possible to generate values of extended precision while doing the intermediate math with single-precision values, and the MPW compilers do this conversion to preserve accuracy.
If your application doesn't need the accuracy, you can declare the parameters
to be of type MPW 3.2 Paslib.o library and standalone codeDate Written: 7/26/91 Last reviewed: 8/30/91 Linking a standalone code resource with the MPW 3.2 Paslib.o library generates the following link error message: The same link works fine if the MPW 3.1 Paslib.o is used. Linking with the new MPW 3.2 Paslib.o causes Pascal modules such as %_MUL4, %_DIV4, %_MOD$, and %_CAT to be stored in a new segment called Paslib 1. However, standalone code resource should just have the one segment. To link a standalone code resource with the MPW 3.2 Paslib.o library, use the -sn option (like -sn PASLIB=Main) to pull all of the Pascal modules into your Main segment. If your main segment is called something other than Main, you can substitute that name in the -sn option instead of Main. For more information on segmentation, check out the "Segmentation" section of Chapter 10 of the MPW Reference Manual. Macintosh toolbox & Pascal procedure parametersDate Written: 6/6/91 Last reviewed: 6/14/93
The Macintosh toolbox does not support nested procedure pointers as parameters,
although Pascal can support them in "native Pascal" usage. Consequently, Pascal
requires that functions like the Pascal Dispose function bugsDate Written: 5/3/89 Last reviewed: 12/17/90
I am having a hard time getting the Pascal function "
Surprisingly,
The first bug has to do with the interaction between the code that the Pascal
compiler creates, and the library routine ( The second bug occurs when trying to free a block of memory that doesn't have any free memory in front of it within its sub-heap. When this occurs, the first block in the heap gets slightly corrupted; your data is still intact, but the header that identifies it gets smashed. The result of this is that the heap routines do not properly detect when the heap is empty and should be disposed of.
These problems are fixed in MPW 3.1. In the meantime, there are a couple of
things you might be able to do. The first is use the Memory Manager routines,
and not the Pascal heap routines. Second, Mark and Release are bug free (and so
is New), so you may try using them. Release will dispose of any additional
allocated heap blocks. NOTE: Mark and Release only work if " Booleans and short circuits don't mixDate Written: 11/17/89 Last reviewed: 6/14/93 I can't get expressions containing Booleans and short circuit in my MPW Pascal program to evaluate correctly. I have to use all of the same type. Is this a bug? Your workaround is correct. Presently this isn't a bug. The MPW documentation states that mixing of short circuits and regular Booleans in the same expression IS NOT supported. It is in Chapter 6, page 100 of the Pascal 3.0 manual. Why Pascal objects in HyperCard XCMDs is a challengeDate Written: 4/24/91 Last reviewed: 6/14/91 Is possible to declare MPW Pascal objects in a HyperCard XCMD? It's possible but very difficult to use Pascal objects in an XCMD because Object Pascal uses the jump table in its method dispatch mechanism. XCMDs and other standalone code resources don't have a jump table. See the Macintosh Technical Note "Stand-Alone Code, ad nauseam" for more information about this. Downloadables
|
|