October 13, 2015
https://issues.dlang.org/show_bug.cgi?id=481

--- Comment #36 from Shriramana Sharma <samjnaa@gmail.com> ---
(In reply to Ketmar Dark from comment #35)
> sorry, i messed dates. :-)
> 
> the `[$]` patch was first merged, and then reverted. this feature will not be in D2, ever: it was decided that one can do almost the same thing with some template magic. it was decided by W&A, so there's no reason to argue if this feature should be included, Masters says their word on it.

Sorry, but I don't think "masters' word" is a technically valid reason for rejecting the request outright. No matter how much work someone put into the language and its compiler, just saying no without saying why or what else can be done is not acceptable. It simply rubs community people the wrong way. If this particular patch's approach to the problem wasn't acceptable, that's a different thing, but the idea itself is most sane and I don't see any reasons provided as to why it should be rejected.

Further, I don't get how Walter/Andrei are supposed to have nixed this. Below in comment #1, Andrei only has something positive to say about this, and neither he nor Walter have said anything negative...

--
October 13, 2015
https://issues.dlang.org/show_bug.cgi?id=481

--- Comment #37 from Ketmar Dark <ketmar@ketmar.no-ip.org> ---
you are welcome to search NG for heated discussions. this issue is setteld down, so there's no reason to argue anymore. alas.

--
October 13, 2015
https://issues.dlang.org/show_bug.cgi?id=481

--- Comment #38 from Shriramana Sharma <samjnaa@gmail.com> ---
Hmmm. I read through the thread starting at http://forum.dlang.org/post/mag5hp$105a$1@digitalmars.com. I think I sorta see the point of the developers here.

While I still think [$] is a cool little tidbit, I also have to agree with the comment which said "let's not add every little tidbit to the language". The title of the request is "letting compiler determine length for fixed-length arrays", not specifically to add [$]. Having the compiler determine the length can be done in many ways, and given that I already have to go to the library for a lot of commonly used stuff like writeln and to!, this one doesn't seem too much more. Although it *does* seem like something you should have out of the box, so do stuff like print()... :-)

The one thing the library solution probably cannot address would be the convoluted examples like a fixed-size array of a dynamic array of fixed-size arrays, but let's face it: those are really contrived examples and not worth introducing a language feature for...

I'm leaving my votes in since I do want *something* to be done to address the actual request, since any such library solution is ATM still sitting over at http://dpaste.dzfl.pl/f49a97e35974 and not actually included in Phobos.

BTW I don't think it should be named just 's' in the std.array module, but something more meaningful, like fixedLengthArray (yikes, yes I know, but I'm open to suggestions) and one can always do something like:

import std.array: f = fixedLengthArray;

--
October 13, 2015
https://issues.dlang.org/show_bug.cgi?id=481

--- Comment #39 from Ketmar Dark <ketmar@ketmar.no-ip.org> ---
tbh, i don't really care, as i've integrated this patch into my private dmd build long time ago and i'm happy with it. so i have no opinion here (yes, i know that "my D" is incompatible with "official D", so what? :-).

--
October 13, 2015
https://issues.dlang.org/show_bug.cgi?id=481

rswhite4@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rswhite4@gmail.com

--- Comment #40 from rswhite4@gmail.com ---
(In reply to Shriramana Sharma from comment #38)
> Hmmm. I read through the thread starting at http://forum.dlang.org/post/mag5hp$105a$1@digitalmars.com. I think I sorta see the point of the developers here.
> 
> While I still think [$] is a cool little tidbit, I also have to agree with the comment which said "let's not add every little tidbit to the language". The title of the request is "letting compiler determine length for fixed-length arrays", not specifically to add [$]. Having the compiler determine the length can be done in many ways, and given that I already have to go to the library for a lot of commonly used stuff like writeln and to!, this one doesn't seem too much more. Although it *does* seem like something you should have out of the box, so do stuff like print()... :-)
> 
> The one thing the library solution probably cannot address would be the convoluted examples like a fixed-size array of a dynamic array of fixed-size arrays, but let's face it: those are really contrived examples and not worth introducing a language feature for...
> 
> I'm leaving my votes in since I do want *something* to be done to address the actual request, since any such library solution is ATM still sitting over at http://dpaste.dzfl.pl/f49a97e35974 and not actually included in Phobos.
> 
> BTW I don't think it should be named just 's' in the std.array module, but something more meaningful, like fixedLengthArray (yikes, yes I know, but I'm open to suggestions) and one can always do something like:
> 
> import std.array: f = fixedLengthArray;

There is a better way:
----
import std.stdio;

pragma(inline, true);
auto s(T, size_t n)(auto ref T[n] arr) {
    return arr;
}

void main() {
    auto arr = [1, 2, 3].s;
    writeln(typeof(arr).stringof);
}
---

--
November 01, 2017
https://issues.dlang.org/show_bug.cgi?id=481

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com

--- Comment #41 from RazvanN <razvan.nitu1305@gmail.com> ---
should this be closed?

--
November 01, 2017
https://issues.dlang.org/show_bug.cgi?id=481

--- Comment #42 from Andrei Alexandrescu <andrei@erdani.com> ---
(In reply to RazvanN from comment #41)
> should this be closed?

Let's keep it open until a library implementation is merged. I'll change the title.

--
November 01, 2017
https://issues.dlang.org/show_bug.cgi?id=481

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Letting compiler determine  |Fixed-length arrays with
                   |length for fixed-length     |automatically computed
                   |arrays                      |length

--
December 24, 2017
https://issues.dlang.org/show_bug.cgi?id=481

greenify <greeenify@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greeenify@gmail.com

--- Comment #43 from greenify <greeenify@gmail.com> ---
The latest work is at: https://github.com/dlang/phobos/pull/4936, but unfortunately it seems like this PR has hit a dead end :(

--
July 13, 2019
https://issues.dlang.org/show_bug.cgi?id=481

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #44 from RazvanN <razvan.nitu1305@gmail.com> ---
Now that we have staticArray [1], this can be closed.

[1] https://github.com/dlang/phobos/pull/6489

--
1 2 3
Next ›   Last »