[J3] [EXTERNAL] Re: USE statement – wish: permit specifying additionally the access-spec
Steven G. Kargl
kargl at troutmask.apl.washington.edu
Fri Nov 15 18:53:10 EST 2019
On Fri, Nov 15, 2019 at 03:38:35PM -0800, Van Snyder via J3 wrote:
> On Fri, 2019-11-15 at 23:04 +0000, Bill Long via J3 wrote:
> > While I'm not part of the Data subgroup, I’m pretty sure that the
> > design for this feature was not an oversight. Rather, it likely had
> > to do with the fact that public and private declarations are limited
> > to being only in a module, whereas USE statements (often) appear
> > outside modules. Sure, you could add in a constraint that the
> > access-spec cannot be specified in a USE statement that is outside a
> > module, but that is just one extra complication that is not needed
> > with the current design.
> >
> > That said, we already permit redundant ways to specify public and
> > private for many other situations. So I would not be opposed to this
> > idea. Some comment from /Data would be informative.
>
> Another reason not to put an access-spec on a USE statement is that a
> scoping unit can have more than one USE statement for the same module.
> What is the effect of
>
> use, private :: A
> use, public :: A
>
Isn't that trivially solved by a constraint?
Something along the lines
Cxxx Within a scoping unit, an access-spec shall not appear in
a use-stmt if module-name has an access-spec from a previous
use-stmt.
--
Steve
More information about the J3
mailing list