From 4b7d499c3dbd5586aa855e54367d95930fd42a81 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 31 Jan 2023 14:07:03 +0100 Subject: Minor improvements; implement saturated function and constructor applications --- snug-clean/src/Snug/Compile/Simulate.dcl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'snug-clean/src/Snug/Compile/Simulate.dcl') diff --git a/snug-clean/src/Snug/Compile/Simulate.dcl b/snug-clean/src/Snug/Compile/Simulate.dcl index 9b938d5..a36dc0d 100644 --- a/snug-clean/src/Snug/Compile/Simulate.dcl +++ b/snug-clean/src/Snug/Compile/Simulate.dcl @@ -18,9 +18,16 @@ from Snug.Syntax import :: BasicValue simulate :: !(Simulator a) -> [Instruction] +//* Build a constructor node with *n* arguments and push it to the stack. buildCons :: !Label !Int -> Simulator () +//* Build a thunk node with *n* arguments and push it to the stack. buildThunk :: !Label !Int -> Simulator () +//* Push a basic value to the stack. pushBasicValue :: !BasicValue -> Simulator () +/** + * Overwrite the node currently under evaluation with an indirection to the + * node on top of the stack, and continue evaluating that node instead. + */ indirectAndEval :: Simulator () -- cgit v1.2.3