Is it time for D 3.0?
Timon Gehr
timon.gehr at gmx.ch
Mon Apr 13 09:17:48 UTC 2020
On 13.04.20 09:30, Kaitlyn Emmons wrote:
> On Monday, 13 April 2020 at 07:13:37 UTC, Kaitlyn Emmons wrote:
>
>
> In d3 can we make all functions and templates aliases to literals?
>
> EG:
> alias fun = (int x, int y) {
> // some fun >.>
> }
>
> alias funT = template(T){
> alias this = (T x, T y){
> // some T fun >o>
> }
> }
>
> Also can we merge the concept of alias this with the way templates work
> by declaring an alias with the same name as the template.
>
>
> Also in d3 can we extend operator overloading to ALL aliases not just
> certain ones..
> Eg i wana declare a namespace that overrides opDispatch
>
>
Some of those suggestions are (to a large extent) backwards compatible.
The reason why operator overloading does not get fixed is that there's a
vocal group of people who think the weird restrictions prevent "abuse".
In reality, e.g., if all you really wanted was to overload the '<'
operator, opCmp is just inefficient and error prone.
Here's a small obvious improvement that would break code massively:
Introduce consistency between template/function declaration and
instantiation/call syntax, e.g.:
auto fun!T(T x,T y)(T z){ ... }
(One template parameter, curried function definition.)
More information about the Digitalmars-d
mailing list