updated lookups to return undefined entry if invalid
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user