3 ms·
Unless there's a difference between yours and mine `dc` that's not quite right: 10 # pushes 10 20 # pushes 20 + # pops 20 10 sums, pushes results
by e12e 5y ago
Unless there's a difference between yours and mine `dc` that's not quite right:
10 # pushes 10
20 # pushes 20
+ # pops 20 10 sums, pushes results
p # prints top of stack (peek)
Equal (`=`) is a conditonal macro invocation `=r`: pops two values off stack, invokes (the contents of register) `r` if they are equal.
[p]sa # store peek stack top as macro in a
1337
10
20
+
30
=a # Stack should be 1337, 30 (20+10) and 30, so should output 1337
# pops 30 and 30; 30==30;p -> top is 1337