record: C# like records for D

vit vit at vit.vit
Fri Jul 16 13:54:36 UTC 2021


On Wednesday, 14 July 2021 at 23:16:05 UTC, Dylan Graham wrote:
> [DUB](https://code.dlang.org/packages/record)
> [Github](https://github.com/hmmdyl/record)
>
> This is record. It aims to implement records similar to what C# 
> has by leveraging D's metaprogramming. [C# Example 
> 1](https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/types/records) [C# Example 2](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/tutorials/records).
>
> Future steps are going to be adding a record struct; default 
> value support; init-only-setters like in C#, wherein at the end 
> of construction or duplication, the init lambda for the field 
> is called, and the field can be set that once.

What adventage has record over normal immutable/const class?



More information about the Digitalmars-d-announce mailing list