If your `stack` and `p` are defined globally and at the beginning (before `PUSH` and `POP` procs), you can do as simple as: var stack: array[10, int] p = -1 proc PUSH(v: int) = inc p stack[p] = v proc POP: int = result = stack[p] dec p proc main = PUSH 1 PUSH 7 let v = POP() echo v main() Run
- How to achieve "mechanical substitution" like C m... liwt31
- Re: How to achieve "mechanical substitution"... moerm
- Re: How to achieve "mechanical substitution&q... miran
- Re: How to achieve "mechanical substituti... mashingan
- Re: How to achieve "mechanical substi... liwt31
- Re: How to achieve "mechanical s... moerm
- Re: How to achieve "mechanic... juancarlospaco