From 32e123beb715cab5f03c2773c4edba2f6e17796a Mon Sep 17 00:00:00 2001 From: Meyer Simon Date: Fri, 28 Feb 2025 12:21:36 -0500 Subject: [PATCH] forgot to remove the comments --- tests/test_real_alpha_file_oneline.alpha | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_real_alpha_file_oneline.alpha b/tests/test_real_alpha_file_oneline.alpha index 423b6e3..01f115e 100644 --- a/tests/test_real_alpha_file_oneline.alpha +++ b/tests/test_real_alpha_file_oneline.alpha @@ -1 +1 @@ -type rec: [integer: x; integer: y] type T1: integer -> integer type T2: rec -> integer function foo : T1 function bar1 : T2 function bar2 : T2 foo(x) := { return x * x; } bar1(a) := { return a.x * a.y; } bar2 as (r,s) := { return r * s; } entry(arg) := { [ integer: result ; rec: w] result := foo(5); w := reserve(w); (* see types.alpha – reserve returns a value of type address, which can be assigned to array and record variables *) w.x := 5; w.y := 7; result := bar1(w); (* pass w (a rec type value) to bar1 *) result := bar2(5,7); (* implicitly build a rec type value, assign 5 and 7 to fields x and y, but call them r and s *) return 0; } +type rec: [integer: x; integer: y] type T1: integer -> integer type T2: rec -> integer function foo : T1 function bar1 : T2 function bar2 : T2 foo(x) := { return x * x; } bar1(a) := { return a.x * a.y; } bar2 as (r,s) := { return r * s; } entry(arg) := { [ integer: result ; rec: w] result := foo(5); w := reserve(w); w.x := 5; w.y := 7; result := bar1(w); result := bar2(5,7); return 0; }