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 | 6200 reads
|
Browse archives
Active forum topics
|
Recent comments
15 weeks 3 days ago
19 weeks 5 days ago
21 weeks 2 days ago
21 weeks 2 days ago
24 weeks 2 hours ago
28 weeks 4 days ago
28 weeks 4 days ago
29 weeks 13 hours ago
29 weeks 13 hours ago
31 weeks 6 days ago