Interesting Research Paper on Constructors in OO Languages

Wyatt wyatt.epp at gmail.com
Tue Jul 16 09:07:29 PDT 2013


On Tuesday, 16 July 2013 at 13:35:00 UTC, Craig Dillabaugh wrote:
> How do you envision this working where Name or Age must be set 
> to
> a value not known at compile time?

I'm not sure if it's practical or covers all the bases, but it 
sounds like you would need to keep track of member initialisation 
during compilation, and abort if the code attempts to use the 
object or one of its members as an AssignExpression without 
initialising the whole thing.

Setting aside the fact that there's compiler work mentioned at 
all, have I missed some nuance of this pattern?  I guess there's 
the situation where you conditionally may or may not assign, or 
pass it around and accrete mutations, so it might be best to only 
do it for some properly-annotated (how?) subset of the whole?  
Not sure.

-Wyatt


More information about the Digitalmars-d mailing list