[Issue 8910] Static arrays, dynamic arrays and std.array.join

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 30 14:04:31 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8910



--- Comment #10 from Daniel Cousens <daniel350 at bigpond.com> 2012-10-30 14:04:16 PDT ---
(In reply to comment #9)
> > Frankly thats a terrible alternative. Perhaps static array specialisations are
> > in order then; assuming current implementations can't be modified to suit.
> 
> So, you think that copying a static array is a good idea? Because that's what
> on overload for a static array would do. And all that overload could do would
> be to slice the static array and pass it to the normal overload (because static
> arrays are _not_ ranges and _cannot_ be, because you can't pop any of their
> elements off), which would lead to the slice being completely invalid once the
> function returned, meaning that the result would be completely unsafe and
> invalid. So no, that wouldn't work.

I do think it is a good idea, no, but that was the "clearest" solution...
second to that proposed by Timon:

 map!(c => c[])(cs[]).join(",");

But if what you say is set in stone, then there is no point taking it further.
Maybe other than the fact putting something in the documentation/compiler
warning so that the error message that is given is not so confusing to those
coming from other languages.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list