This commit is contained in:
Scarlett
2025-05-03 19:25:55 -04:00
parent fbd08c634a
commit ea7c284665
64 changed files with 121 additions and 995 deletions

View File

@ -0,0 +1,29 @@
$$ TEST: [-asc -tc]
(* Type definitions *)
type int2int: integer -> integer
type string2int: string -> integer
(* Function declarations
They use the above type definitions
*)
function square : int2int
function entry : string2int
(* Function definition
Functions must be declared before they are defined
*)
square(x) := {
return x * x;
}
(* Function definition
entry is the first function called
*)
entry(arg) := {
[ integer: input ; integer: expected ; integer: actual ; Boolean: result ]
input := 7;
expected := 49;
actual := square(input);
result := expected = actual;
return 0;
}