DIP proposal: Enum parameters
bauss
jacobbauss at gmail.com
Tue Sep 27 12:23:18 UTC 2022
On Tuesday, 27 September 2022 at 12:13:53 UTC, Paul Backus wrote:
> On Tuesday, 27 September 2022 at 11:52:03 UTC, bauss wrote:
>> Like how is this:
>>
>> ```
>> auto opSlice()(enum size_t l, enum size_t u) => slice!(l, u);
>> ```
>>
>> An improvement over:
>>
>> ```
>> auto opSlice(size_t l, size_t u)() => slice!(l, u);
>> ```
>>
>> Maybe I am not entirely grasping this concept or something.
>
> The only difference is that at the call site, you can write
> `opSlice(i, j)` instead of `opSlice!(i, j)`. It's pure syntax
> sugar.
Yeah that's what I thought.
I'm not for this particular DIP then. I think adding more
keywords is going to make the language much more messy.
More information about the Digitalmars-d
mailing list