How do I create classes dynamically?

novice3 sorryno at em.ail
Fri Apr 16 08:28:09 UTC 2021


On Thursday, 15 April 2021 at 20:56:18 UTC, mw wrote:
>
> In response to user input?
>
> e.g. createObject(userInputString);
>

what if user enter "Cthulhu"?

if you say "i will check user input",
then you know list of possible inputs,
then you can use some compile-time technics.

if you dont know possible user inputs,
and user can input anything,
then questions raised:
- what is object Cthulhu meaning?
- what properties and methods it has?
etc...


More information about the Digitalmars-d-learn mailing list