From Rosetta code, I'm using the following as a way to concatenate strings in Forth.
s" hello" pad place
pad count type
s" there!" pad +place
pad count type
Using this code, I'd like to be able to concatenate multiple strings together. However, the following fails on Gforth
s" hi " pad place
s" hello " pad place
s" world" pad
+place
pad +place
pad count type
From my basic Forth exposure, I see the code as putting three strings on the stack, then appending the string on the top of the stack with the string below it, then appending the new string on the stack again with the bottom one.
Why does this code underflows on the last +place? Is there a way around this?