runtime/src/common/RTProcedure.i3


Copyright (C) 1994, Digital Equipment Corp.

RTProcedure provides runtime access to the fingerprints of procedures.

A procedure's fingerprint is a 64-bit checksum computed from its name and signature. The probability of distinct procedures having the same fingerprint is very small. See the Fingerprint interface for more details.

INTERFACE RTProcedure;

IMPORT Fingerprint;

TYPE Proc = ADDRESS;
Representing a procedure by its address seems to be the best Modula-3 approximation we can give for the supertype of all procedure types.

PROCEDURE ToFingerprint(p: Proc): Fingerprint.T;
Return the fingerprint of the top-level procedure p. It is a checked runtime error if p is not a top-level procedure.

PROCEDURE FromFingerprint(READONLY fp: Fingerprint.T): Proc;
Return the address of the top-level procedure with fingerprint fp. If no such procedure exists, returns NIL.

END RTProcedure.