Download PERQ PERQ"PASCAL EXTENSIONS
Transcript
December 27, 1983 PERQ Pascal Extensions 11. Generic Types Generic types are general forms of more specific types. PERQ Pascal provides two predefined generic types: 1) Pointers 2) Files 11.1 Generic Pointers Generic pointers provide a tool for generalized pointer handling. Variables of type POINlER can be used in the same manner as any otherpointer variable with the following exceptions: 1) Since there is no notion of type associated with the reference variable of a generic pointer, generic pointers cannot be dereferenced. 2) Generic pointers cannot be used as an argument to NEW or_ DISPOSE. 3) pointer type can be passed to a generic pointer parameter. To make use of a generic pointer, RECAST should be used to convert the pointer to some usable pointer type. Any - 14 -