(*
    Title: 	Goto - Definitions
    LastEdit:	"Tue Sep 18 16:21:21 1984"
    Author: 	Mick Jordan
		Cambridge University Computer Laboratory

    Non-local transfer of control
*)

DEFINITION MODULE Goto;

EXPORT QUALIFIED 
    GotoLabel, SetGoto, LongGoto, UnSetGoto;

TYPE GotoLabel;
(*  hidden type used by an implementation to represent an gironment.
*)
    
PROCEDURE SetGoto(VAR g: GotoLabel);
(*  returns in 'g' the environment corresponding to the return from
    the call of 'SetGoto'.  A subsequent 'LongGoto' with 'g' as
    argument will cause execution to resume at the statement immediately
    following the call of 'SetGoto'.  Space in which to store the
    environment data is allocated from the heap (see UnSetGoto).
*)

PROCEDURE LongGoto(g: GotoLabel);

PROCEDURE UnSetGoto(g: GotoLabel);
(*  Useful in programs which repeatedly call SetGoto in recursive
    procedures as it ensures that any space allocated for 'g' is
    returned to the heap.
*)

END Goto.
