May 04

On Tuesday, 4 May 2021 at 17:45:53 UTC, Paul Backus wrote:

>

On Tuesday, 4 May 2021 at 17:39:54 UTC, Q. Schroll wrote:

>

On Tuesday, 4 May 2021 at 16:54:13 UTC, Andrei Alexandrescu wrote:

>

I put together a bunch other related pull requests:

https://github.com/dlang/phobos/pulls/andralex

Using alias assignment with good measure leads to much simpler and clearer code. I also measured memory consumption improvements, but for the Phobos unittest they are not dramatic.

Is there some resource where the rules for alias assignments are spelled out? Googling '"alias assignment" site:dlang.org' produces no meaningful results. Having procedural aspects in a declarative space looks a bit odd to me. The change logs revealed nothing.

There's an open spec PR:

https://github.com/dlang/dlang.org/pull/2919

How does something like this not require a DIP?

May 04

On Tuesday, 4 May 2021 at 18:19:10 UTC, Q. Schroll wrote:

>

On Tuesday, 4 May 2021 at 17:45:53 UTC, Paul Backus wrote:

>

On Tuesday, 4 May 2021 at 17:39:54 UTC, Q. Schroll wrote:

>

On Tuesday, 4 May 2021 at 16:54:13 UTC, Andrei Alexandrescu wrote:

>

I put together a bunch other related pull requests:

https://github.com/dlang/phobos/pulls/andralex

Using alias assignment with good measure leads to much simpler and clearer code. I also measured memory consumption improvements, but for the Phobos unittest they are not dramatic.

Is there some resource where the rules for alias assignments are spelled out? Googling '"alias assignment" site:dlang.org' produces no meaningful results. Having procedural aspects in a declarative space looks a bit odd to me. The change logs revealed nothing.

There's an open spec PR:

https://github.com/dlang/dlang.org/pull/2919

How does something like this not require a DIP?

For example, staticMap can be implemented iteratively like this:

alias staticMap(alias f, args...) = mixin(() {
        string result = "AliasSeq!(";
        static foreach (i; 0 .. args.length)
            result ~= mixin(`"f!(args[`, i, `])"`);
        return result ~ ")";
    }());

I agree it leads to simpler code. I just don't know if it's worth it.

May 04

On Tuesday, 4 May 2021 at 18:19:10 UTC, Q. Schroll wrote:

>

On Tuesday, 4 May 2021 at 17:45:53 UTC, Paul Backus wrote:

>

There's an open spec PR:

https://github.com/dlang/dlang.org/pull/2919

How does something like this not require a DIP?

Beats me. Seems like at the very least it should have a -preview switch.

I suspect the actual answer is "it's Walter's PR, and Walter can get away with ignoring the official process." If you click through to the DMD PR you can see some discussion about this.

Next ›   Last »
1 2 3