Artyom Tarasenko wrote:
Mainly by looking at the Forth; it seems that all the code snippets I've seen expect the stack to be preserved. Otherwise if we always push all 5 arguments, we'll end up with an excess of 0s being built-up on the stack by every call.
I agree that the stack should be preserved, but why not just do it literary by throwing away unused arguments? In the current implementation there is no way to pass 0 as the last argument. Do you think it's ok?
I think so - it's difficult to know. That was the other option of course, which is to push everything onto the stack and then clear the stack after the call has finished. But this comes down to does the client program expect the stack to be preserved across subsequent calls to obp_fortheval_v2? The current approach does this, although we don't know whether it's a specific requirement or not.
ATB,
Mark.