Re: D1: How to declare an Associative array with data

2019-09-05 Thread Kagamin via Digitalmars-d-learn
Maybe something like this https://forum.dlang.org/post/hloitwqnisvtgfoug...@forum.dlang.org

Re: D1: How to declare an Associative array with data

2019-09-04 Thread jicman via Digitalmars-d-learn
On Wednesday, 4 September 2019 at 13:39:05 UTC, Adam D. Ruppe wrote: On Wednesday, 4 September 2019 at 13:33:02 UTC, jicman wrote: string[] d = ["1","2","three","4]; and this will be done at compiled time. I want to do the same with an associative array., ie. That's actually only at compile

Re: D1: How to declare an Associative array with data

2019-09-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 4 September 2019 at 13:33:02 UTC, jicman wrote: string[] d = ["1","2","three","4]; and this will be done at compiled time. I want to do the same with an associative array., ie. That's actually only at compile time if it is in static scope, if it inside a function, it is a runt

D1: How to declare an Associative array with data

2019-09-04 Thread jicman via Digitalmars-d-learn
Yes, I know. I am using D1, and I love it. ;-) Greetings. I know that I can declare an array with data, ie. string[] d = ["1","2","three","4]; and this will be done at compiled time. I want to do the same with an associative array., ie. int[string] MyDigits = ["0" = 0, "1" = 1, "2" = 2]