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

2019-11-10 Thread JN via Digitalmars-d-announce

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.




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

2019-11-10 Thread SealabJaster via Digitalmars-d-announce

On Sunday, 3 November 2019 at 08:37:07 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.


#3: https://bradley.chatha.dev/Home/Blog?post=JsonSerialiser3

I'm considering making a #3.1 post (similar to the #1.1 post) 
that shows how __traits(hasMember), 
__traits(getMember)/__traits(allMembers), alongside some things 
in std.traits like Parameters and ReturnType, could be used 
instead of __traits(compiles).


Also, until run.dlang.io's ability to create links is fixed, the 
usual links to snippets won't take you anywhere.