Wait a moment, are you shure this D code is equivalent to the Nim code you just 
posted? 
    
    
    struct Bar { void bar() { "bar".writeln; } }
    

To me this looks like just a _method_ (in c++ terms). And a _method_ is not a 
value member of a struct. In other words it does not increase the size, it is 
just the object-oriented way to say this function takes Bar as first argument, 
and the syntax to call it is a bit different. But it is not stored at all in 
the struct.
    
    
    type
      Bar = object
    
    proc bar(arg: Bar): void = echo "bar"
    

Reply via email to