On Fri, 2017-03-17 at 17:51 +0000, Jerry via Digitalmars-d-learn wrote: > On Friday, 17 March 2017 at 17:13:48 UTC, Russel Winder wrote: > > I have a bit of code: > > > > string[] returnValue; > > foreach(string key, string[] value; groups) { > > returnValue ~= > > value.sort!debianPackageNumberComparator()[0..$-1].array; > > } > > return returnValue; > > > > [...] > > You forgot a ! on the map call. > > .map!((Tuple!(string, string[]) a) => > a[1].sort!debianPackageNumberComparator()[0..$-1])
How embarrassed am I? :-) However, the result of the map appears to be untransformable to anything related to a sequence of string. The result is some type that renders as a sequence of sequence using writeln but how to reduce it to a sequence? reduce isn't defined on MapResult and if I transform to an array reduce is not defined on SortedRange[]. Rust ownership problems seem to be a doddle compared to this problem. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part