foo => "bar" key/value literals in D!

Era Scarecrow via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Tue May 31 02:26:51 PDT 2016


On Monday, 23 May 2016 at 19:00:40 UTC, Adam D. Ruppe wrote:
> Have I gone completely mad?!?!
>
> ---
> void main() {
>         import std.stdio;
>         writeln(obj!(
>                 foo => "bar",
>                 baz => 12
>         ));
> }
> ---
>
> Prints out:
>
> {
>         foo: bar
>         baz: 12
> }

  Pretty snazzy :) Like enums, except not...


More information about the Digitalmars-d-announce mailing list