Yes, `object` is a value, `ptr object` is a non-garbage-collected pointer to an 
object, `ref object` is a garbage-collected pointer to an object, `object of 
...` is the way to inherit, to be combined with any of the previous, and after 
any of that a list of fields may go.

`RootObj` is not smth special and built-in, it's defined in `system.nim` (like 
many other things, read that module for better understanding) as `type RootObj* 
{.inheritable.} = object`, a predefined root for inheritance hierarhies, but 
you can create separate hierarchies (your own roots) the same way, marking your 
object type as `{.inheriatable.}`.

`Class3 = ref Class1` \- values of this type will be double references: 
references to referenced (`Class1`) subtype of empty objects (`RootObj`).

Reply via email to