raz / conform / run / mods / Inl.raz

25 lines · 410 B · raw · history · last change 88e6b860

1(* Procedures that only return, for Inline: imported, one reading a
2 variable this module hides, one calling a generic module's. *)
3module Inl;
4import Box := Cell(INT);
5
6var hidden: INT;
7
8proc twice*(x: INT): INT;
9begin
10 return 2 * x;
11end;
12
13proc plusHidden*(x: INT): INT;
14begin
15 return x + hidden;
16end;
17
18proc boxed*(x: INT): INT;
19begin
20 return Box.add(x, 1);
21end;
22
23begin
24 hidden := 100;
25end Inl.