User loginNavigation |
Extensible nesting of classesMany languages support aggressive nesting, from the syntax-only nesting of Java and C# to the more semantically meaningful nesting of BETA and Scala; e.g., a nested class in Scala is qualified by the type of its creating objecting. In any case, a class Inner is only nested in a class Outer if it is physically expressed within it. I was wondering if anyone ever considered containment constraints before. Rather than nest class Inner in class Outer, why not just specify that class Inner could only be instantiated in the context of an instance of class Outer? This makes containment more like inheritance: class Subclass can inherit from class Superclass after Superclass has been created, and perhaps even in a different module. Why not do the same with containment? Any references would be helpful. I've turned up some of the basics nesting papers, however I haven't found anyone ever considering containment constraints before. That seems strange as this seems like one of those obvious generalizations. By Sean McDirmid at 2011-03-28 17:43 | LtU Forum | previous forum topic | next forum topic | other blogs | 6395 reads
|
Browse archives
Active forum topics |
Recent comments
27 weeks 2 days ago
27 weeks 2 days ago
27 weeks 2 days ago
49 weeks 3 days ago
1 year 1 week ago
1 year 3 weeks ago
1 year 3 weeks ago
1 year 5 weeks ago
1 year 10 weeks ago
1 year 10 weeks ago