[Grace-core] inconsistent defaults with modules

Andrew P. Black black at cs.pdx.edu
Fri May 30 10:37:29 PDT 2014


On 30 May 2014, at 10:26, Kim Bruce <KIM at cs.pomona.edu> wrote:

> It just occurred to me that I believe we never discussed the default visibility of class declarations.  I believe that like methods and types, they should be public, but could understand arguments the other way.  For the most part it wouldn't matter as most classes are defined at the top level, but it would make a difference when importing libraries as I believe most top level classes being imported would be desired to be public.  (Of course it would also cause the least disruption for existing code if class definitions were by default public.)
> 
> The main thing is we should make a decision.
> 

Since a class declaration defines a special kind of method, I think that it makes sense for that method to be public.

The “old style” class declaration was like a def that bound a name to an object, so it’s default visibility would have presumably been confidential.   But we should stop using those, and eventually make them go away.

An easy thing for Femi to cut his teeth on would perhaps be to make ClassMethods the default, and to add a pragmas ClassObjects and NoClassObjects to control the use of the old class syntax.

Which reminds me: the head of my master branch no longer allows class methods.    This was because I merged in a change of Michael’s that deleted that feature from the compiler.    I’m working from an earlier revision, but should revert the head, if I can figure out how to do that.   I’ll try to do it today.

	Andrew


More information about the Grace-core mailing list