From b3d2d0bfcfb1fcff0326436aedc6fe2456df3217 Mon Sep 17 00:00:00 2001 From: Chris Pressey Date: Tue, 12 Dec 2017 10:10:58 +0000 Subject: [PATCH] Clearing up a little mystery I had here. --- eg/proto-game.60p | 4 ++++ tests/SixtyPical Analysis.md | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/eg/proto-game.60p b/eg/proto-game.60p index c6f0436..56aa5e4 100644 --- a/eg/proto-game.60p +++ b/eg/proto-game.60p @@ -123,6 +123,10 @@ routine clear_screen // Game States // ---------------------------------------------------------------- +// +// Because these all `goto save_cinv` at the end, they must have the same signature as that routine. +// + routine game_state_play inputs joy2, pos outputs delta, pos, dispatch_game_state, screen, screen1 diff --git a/tests/SixtyPical Analysis.md b/tests/SixtyPical Analysis.md index 96c9df4..9b95718 100644 --- a/tests/SixtyPical Analysis.md +++ b/tests/SixtyPical Analysis.md @@ -1513,6 +1513,30 @@ But not if the vector is declared inappropriately. | } ? IncompatibleConstraintsError +"Appropriately" means, if the routine affects no more than what is named +in the input/output sets of the vector. + + | vector vec + | inputs a, x + | outputs x + | trashes a, z, n + | + | routine foo + | inputs x + | outputs x + | trashes z, n + | { + | inc x + | } + | + | routine main + | outputs vec + | trashes a, z, n + | { + | copy foo, vec + | } + = ok + Routines are read-only. | vector vec