How do I create classes dynamically?

Imperatorn johan_forsberg_86 at hotmail.com
Fri Apr 16 08:31:27 UTC 2021


On Thursday, 15 April 2021 at 22:06:23 UTC, Jack wrote:
> On Thursday, 15 April 2021 at 17:48:02 UTC, Imperatorn wrote:
>> On Thursday, 15 April 2021 at 16:39:30 UTC, Kagamin wrote:
>>> On Wednesday, 14 April 2021 at 20:38:16 UTC, Mario wrote:
>>>> [...]
>>>
>>> String mixins is D replacement of macros for code generation.
>>> Works like this:
>>> ```d
>>> mixin("class MyDynamicClassName { }");
>>> MyDynamicClassName cls = new MyDynamicClassName;
>>> ```
>>
>> Yes but not at runtime
>
> Could you give an example of what you're trying to archive?

One example would be a repl


More information about the Digitalmars-d-learn mailing list