Re: why there is a [] at the end of assocArray

2022-01-19 Thread MichaelBi via Digitalmars-d-learn
On Wednesday, 19 January 2022 at 16:36:36 UTC, Ali Çehreli wrote: On 1/19/22 06:06, michaelbi wrote: On Wednesday, 19 January 2022 at 13:21:32 UTC, Stanislav Blinov wrote: On Wednesday, 19 January 2022 at 13:15:35 UTC, michaelbi wrote: [...] [...] ...because there's an empty line at

Re: why there is a [] at the end of assocArray

2022-01-19 Thread Ali Çehreli via Digitalmars-d-learn
On 1/19/22 06:06, michaelbi wrote: On Wednesday, 19 January 2022 at 13:21:32 UTC, Stanislav Blinov wrote: On Wednesday, 19 January 2022 at 13:15:35 UTC, michaelbi wrote:     foreach(line; > File("input.txt").byLine.map!(a=>a.idup).array.transposed) so why there is

Re: why there is a [] at the end of assocArray

2022-01-19 Thread jfondren via Digitalmars-d-learn
On Wednesday, 19 January 2022 at 14:06:45 UTC, michaelbi wrote: i got it, though i still don't know where the [] come from. $ rdmd --eval 'writeln("".array.strip.sort.group.assocArray)' [] $ rdmd --eval 'writeln(typeid("".array.strip.sort.group.assocArray))' uint[dchar] It's what an empty

Re: why there is a [] at the end of assocArray

2022-01-19 Thread michaelbi via Digitalmars-d-learn
On Wednesday, 19 January 2022 at 13:21:32 UTC, Stanislav Blinov wrote: On Wednesday, 19 January 2022 at 13:15:35 UTC, michaelbi wrote: foreach(line; > File("input.txt").byLine.map!(a=>a.idup).array.transposed) so why there is a [] at the end of assocArray printed? than

Re: why there is a [] at the end of assocArray

2022-01-19 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 19 January 2022 at 13:15:35 UTC, michaelbi wrote: foreach(line; > File("input.txt").byLine.map!(a=>a.idup).array.transposed) so why there is a [] at the end of assocArray printed? thanks. ...because there's an empty line at the end of input.txt?

why there is a [] at the end of assocArray

2022-01-19 Thread michaelbi via Digitalmars-d-learn
writeln(sortgroup); } } output: ['1':7, '0':5] ['1':5, '0':7] ['1':8, '0':4] ['1':7, '0':5] ['1':5, '0':7] [] so why there is a [] at the end of assocArray printed? thanks.