October 20, 2020
On Tuesday, 20 October 2020 at 08:52:07 UTC, Basile B. wrote:

>
> yeah, CTFE on `version()` would be basically like `static if (ident <op> ident)` and alikes, so `version()` much less justified because not special anymore.
>
> By the way, to the attention of James, the other day I've found this nice helper by Simons K: https://forum.dlang.org/post/tghdaffyugrajmenddav@forum.dlang.org, allowing to use version idents in static if expressions, the easiest way possible.

It takes a special kind of stubbornness to reject the fact that version's limitations failed to serve their purpose.
October 20, 2020
On Tuesday, 20 October 2020 at 10:16:26 UTC, Max Samukha wrote:
> On Tuesday, 20 October 2020 at 08:52:07 UTC, Basile B. wrote:
>
>>
>> yeah, CTFE on `version()` would be basically like `static if (ident <op> ident)` and alikes, so `version()` much less justified because not special anymore.
>>
>> By the way, to the attention of James, the other day I've found this nice helper by Simons K: https://forum.dlang.org/post/tghdaffyugrajmenddav@forum.dlang.org, allowing to use version idents in static if expressions, the easiest way possible.
>
> It takes a special kind of stubbornness to reject the fact that version's limitations failed to serve their purpose.

IIRC the main rationale for version limitations is that they are supposed to prevent bugs related to preprocessors in other languages, which may be counter- intuitive to verify: People complain that it's not super friendly to combine versions but do they complain because of pernicious bugs inherent to the lack of combinations ?

side note: I'm not especially pro D-versions (my toy language allows version operator for example [1]), but I understand why they are limited in D. It's been explained many times.

[1]: https://gitlab.com/basile.b/styx/-/blob/master/src/styx/semantic/versions.d#L403
November 12, 2020
On Wednesday, 14 October 2020 at 17:20:46 UTC, Basile B. wrote:
> Example usage, probably the only that's interesting at first glance.
>
> ---
> version(D_Coverage)
>     enum do_inline = true;
> else
>     enum do_inline = false;
>
>
> pragma(inline, do_inline)
> void stuff(){}
> ---
>
> Although this could be controlled from the command line side, i.e if -cov is there then be smart and dont put -inline.

https://github.com/dlang/dmd/pull/11954
November 12, 2020
On Thursday, 12 November 2020 at 00:54:35 UTC, Nicholas Wilson wrote:
> On Wednesday, 14 October 2020 at 17:20:46 UTC, Basile B. wrote:
>> Example usage, probably the only that's interesting at first glance.
>>
>> ---
>> version(D_Coverage)
>>     enum do_inline = true;
>> else
>>     enum do_inline = false;
>>
>>
>> pragma(inline, do_inline)
>> void stuff(){}
>> ---
>>
>> Although this could be controlled from the command line side, i.e if -cov is there then be smart and dont put -inline.
>
> https://github.com/dlang/dmd/pull/11954

Hi, thanks for trying the feature. I've created an issue[1] that can be referenced in the PR ;)

[1] https://issues.dlang.org/show_bug.cgi?id=21378
1 2
Next ›   Last »