updated lookups to return undefined entry if invalid

This commit is contained in:
Partho Bhattacharya
2025-03-28 13:47:53 -04:00
parent 2654308396
commit 36694a2f4a
3 changed files with 47 additions and 25 deletions

View File

@ -18,10 +18,10 @@ bar2 as (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 := 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;
}
}