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 | 6342 reads
|
Browse archives
Active forum topics |
Recent comments
16 weeks 8 hours ago
16 weeks 11 hours ago
16 weeks 12 hours ago
38 weeks 1 day ago
42 weeks 3 days ago
44 weeks 19 hours ago
44 weeks 19 hours ago
46 weeks 5 days ago
51 weeks 3 days ago
51 weeks 3 days ago