;'2706 410'
~{.@\%.}do;
From the GCD example. It looks like the pop and discard at the start will do nothing, so why is it there?
;'2706 410'
~{.@\%.}do;
From the GCD example. It looks like the pop and discard at the start will do nothing, so why is it there?
The program starts with the contents of standard input at the top of the stack. The pop discards this unused input so that it is not printed when the program exits.
From the tutorial:
There is no explicit input command in GolfScript, instead when your script is executed, all input from stdin is read first and placed as a string onto the stack.
and:
When your script reaches the end. The contents of the stack are printed automatically.