Re: Re: Visibility
Rohan Hart <[email protected]> Fri, 25 Mar 2005 11:34:52 +1200
| Newsgroups | gmane.comp.lang.nice.general |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 25 Mar 2005, Daniel Bonniot said: > However, the question is whether classes define scopes or not. It's > equally simple to decide that modules define scopes, not > classes. Both choices can be seen as consistent with Java, where > (basically) there is only one toplevel class per file/module. We are in complete agreement, "private" must be scoped to the module in Nice to make any sense for multi-methods. On the other hand, classes at the *syntactic* level define a scope via bracketing and objects are created from classes not modules. All I'm really arguing for is to make the scope of the visibility explicit at the definition point. >> For simplicity perhaps the more radical suggestion of having each >> package definition in a single file and only public and package >> visibility. > I see a package as containing a (minimal) set of features (classes and > methods) that provide a certain functionality. In some cases, having all of > them in the same file would make the file too big. Being able to split a > package into several files helps the internal organisation, while that > organisation is hidden to public clients. Other languages seem to do alright with one file per package. Perhaps thats because they can re-export imported symbols which allows for package aggregation, ie., one public package and several internal packages. Nice and Java only provide this implicitly. > Neither, only something much less restrictive: disallow _dispatch_ on > interface types (only for non-public methods, that's understood). Disallowing interface targets seems reasonable. Rohan ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click