module Generic; import Out, Stack, Ints := Pile(I64), More := Pile(I64), Strs := Pile([]const U8); import SYSTEM; proc yes(b: BOOL); begin if b then Out.str("true"); else Out.str("false"); end; end; proc main*; var l: Strs.Pile; v: I64; s: []const U8; ok: BOOL; begin ok := Ints.push(Stack.p, 7); ok := More.push(Stack.p, 8); (* two imports, one instance: one pile *) Out.int(Stack.top()); Out.char(' '); Out.int(Stack.p^.len); Out.char(' '); yes(ok); Out.ln; v, ok := Ints.pop(Stack.p); Out.int(v); Out.char(' '); Out.int(Stack.p^.len); Out.ln; ok := Strs.push(SYSTEM.ADR(l), "b"); ok := Strs.push(SYSTEM.ADR(l), "a"); s, ok := Strs.pop(SYSTEM.ADR(l)); Out.str(s); Out.str(Strs.top(SYSTEM.ADR(l))); yes(ok); Out.ln; s, ok := Strs.pop(SYSTEM.ADR(l)); s, ok := Strs.pop(SYSTEM.ADR(l)); Out.char('['); Out.str(s); Out.str("] "); yes(ok); Out.ln; end; end Generic.