In Python, I can do this:
my_obj = Obj()
string_from_func = func()
setattr(my_obj, string_from_func, 100)
Say func() returns "member1" or "member2", the setattr would then
set either one of those to 100.
Is there any equivalent in D?