> It seems to be valid Nim code.

That's what I wanted to know, thanks!

> It's also a design right from the 90ies, slow, impossible to parallelize, 
> hard to serialize.

I know. I wouldn't have come up with the design if I wrote it myself, because 
it is a straight port of the Python tutorial code.

Yes, I have been in C++ for long enough to have seen some really horrible OOP 
code, especially from 90's and the early 2000's 

> If you do want to use inheritance, then you may want to mark the root objects 
> of your own inheritance hierarchy as {.inheritable.} instead of inheriting 
> from RootObj. Inheriting from RootObj means that you can assign anything to 
> variables of type RootRef. This can be useful (e.g. for debugging purposes), 
> but also means that you can possibly get types mixed up.

That is interesting!

I wish there were more tutorials / manual material that dealt with objects - 
and explains the various pragmas (are they called pragmas?) - that is really 
useful information, thanks! 

Later on, when the entire tutorial has been ported, and I know Nim more, I will 
definitely be revising the architecture, that's for sure.

Reply via email to