On Saturday, 28 October 2023 at 13:13:16 UTC, Paul Backus wrote:
>On Thursday, 26 October 2023 at 11:18:46 UTC, kdevel wrote:
>Accessing Elements Of An AA
string[string] aa;
aa["name"] = "value";
writeln (i"The name in s is $(aa[\"name\"])"
That typing is laborious. Isn't there a way to bind the expression to the keys of the AA?
You can do this with existing language features: https://run.dlang.io/is/QRFNpg
Although I wouldn't really recommend it, since it forces you to write fully-qualified names to access anything that isn't an associative-array key.
https://run.dlang.io/is/jyNmOi
different solution