Blog series to teach and show off D's metaprogramming by creating a JSON serialiser

Steven Schveighoffer schveiguy at gmail.com
Mon Nov 11 17:33:39 UTC 2019


On 11/10/19 5:50 PM, JN wrote:
> On Sunday, 10 November 2019 at 10:22:17 UTC, SealabJaster wrote:
>> Next post is out, I feel kind of iffy over how I went over classes, 
>> but I think for the most part it came out ok. I probably won't touch 
>> classes specifically in any future post though, unless I can think of 
>> something interesting to do with them.
> 
> It's outside of the scope of the tutorial, but the "tough" part in 
> serializing classes is realizing that they're a reference type rather 
> than value type. Just like with serializing pointers, I could have two 
> references pointing to the same class object, and a smart deserializer 
> would create only one class object and point both references to it.
> 

The tough part about serializing classes is if the class is not final, 
how do you serialize the derived data. It requires some sort of user 
help to tell it how to get at the data.

-Steve


More information about the Digitalmars-d-announce mailing list