Closed GorNishanov closed 2 years ago
The notion of scope in IPR is more general than that of Standard C++. In IPR, a Scope
is just a sequence of declarations, with no specific attachment to a declarative region. The Standard C++ notion of scope is obtained by pairing a declarative Region
and a Scope
. It makes sense for Region
to provide an operation declarations()
that retrieves all declarations from a Region
(whether lexical or resident), but it is not clear that the operation members()
of Scope
must be moved out.
Given that a Scope
is a sequence of declaration, it is not clear what this suggestion would really accomplish. I am going to close this suggestion for now. Please, reopen if and when there is new information to change the design.
Currently, Region is just a host for a scope which contains both a sequence a declaration (in the order they appear in the region) and a lookup by name and type for a scope.
There are cases where a declaration lexically appears in one region, but, added to a scope in a different (usually in the home) region.
Tentative suggestion is to move members() from scope into a region.