Contents | Prev | Next | Index


Procedure Types

Canterbury Pascal allows procedure and functions to be treated as entities that can be assigned to variables and passed as parameters. Such actions are made possible through procedural types. They can be thought of as pointers to procedures or functions.

The syntax for a procedural type declaration is the same as that of a procedure or function heading, except that the identifier after the PROCEDURE or FUNCTION keyword is omitted. The following grammar shows Java-specific language extensions in red color.

procedure_type  ::= procedure formal_parameters
                ::= procedure
                ::= function func_parameters
procedure ::= modifier PROCEDURE
function ::= modifier FUNCTION
modifier ::= java_modifiers
::= <empty>

Notice, that Canterbury Pascal, unlike Borland Object Pascal, does neither support method pointers nor the optional specification of a calling convention for procedural type declarations.

A procedural variable can only be assigned to non-nested procedures or functions.


Contents | Prev | Next | Index

Canterbury Pascal for JVM  (Last documentation update Sep 02, 2004)
Copyright © 1999-2004 J.Neuhoff - mhccorp.com  . All rights reserved.
Please send any comments or corrections to neuhoff@mhccorp.com