Skip to content

Is there an upper limit on locals depth? #183

Answered by ruv
SirWumpus asked this question in Q&A
Discussion options

You must be logged in to vote

is there an upper limit as to the max. definition depth for supporting locals?

What do you mean by "definition depth"?

If you mean how many local variables in total can exist at once during program execution, — there is no such upper limit for programs (after which an environment dependency must be declared) or minimum requirement for systems.

Typically, locals are stored on the return stack, so this falls under 4.1.2 Ambiguous conditions:

  • insufficient data-stack space or return-stack space (stack overflow).

I think a similar ambiguous condition should be declared in 13.4.1.2 to cover the case where local variables are stored somewhere else (e.g., on a separate stack of local variables).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SirWumpus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
clarification Rationale or explanation to the Forth standard
2 participants