Files
compiler-the-translators/tests/sprint3/test/sp3_carls_second_mistake.alpha
Scarlett d05b6f456c rebase
2025-04-02 11:55:25 -04:00

25 lines
864 B
Plaintext

type string: 1 -> character
type a_of_s: 1 -> string
(* maybe some other type definitions *)
entry(arg) := {
[ string: one_name; string: another_name; a_of_s: many_names ]
one_name := "a string literal";
another_name := reserve another_name(4); (* reserve space for an an array of character, with 4 members *)
another_name(0) := 'C';
another_name(1) := 'a';
another_name(2) := 'r';
another_name(3) := 'l';
a_of_s := reserve a_of_s(3);
a_of_s(0) := one_name;
a_of_s(1) := another_name;
many_names(2) := reserve many_names(2)(6); (* reserve space for an item of the same type as a_of_s(2), an array of character, with 6 members *)
many_names(2)(0) := "P";
many_names(2)(1) := "a";
many_names(2)(2) := "r";
many_names(2)(3) := "t";
many_names(2)(4) := "h";
many_names(2)(5) := "o";
return 0;
}