On Thursday, 28 April 2022 at 04:33:18 UTC, Walter Bright wrote:
>[...]
Unfortunately, some C compilers use __assert. Arghh!
1.
>__assert__
2.
>__assertion
3.
>__assertor
4.
>__asserted
SDB@79
Thread overview | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
April 27, 2022 Asking for advice - assert for ImportC | ||||
---|---|---|---|---|
| ||||
I put in a PR to add __assert(assign-expression) to ImportC, for reasons explained in the PR: https://github.com/dlang/dmd/pull/14026 Unfortunately, some C compilers use __assert. Arghh! I seem unable to come up with a decent name. Advice welcome! |
April 28, 2022 Re: Asking for advice - assert for ImportC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Do we really need to be introducing our own unique extensions for C that can introduce new conflicts later on? |
April 28, 2022 Re: Asking for advice - assert for ImportC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Thursday, 28 April 2022 at 04:33:18 UTC, Walter Bright wrote:
> I put in a PR to add __assert(assign-expression) to ImportC, for reasons explained in the PR:
>
> https://github.com/dlang/dmd/pull/14026
>
> Unfortunately, some C compilers use __assert. Arghh!
>
> I seem unable to come up with a decent name. Advice welcome!
_D_assert
___assert
|
April 28, 2022 Re: Asking for advice - assert for ImportC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Thursday, 28 April 2022 at 04:33:18 UTC, Walter Bright wrote: >[...] 1. >
2. >
3. >
4. >
SDB@79 |
April 28, 2022 Re: Asking for advice - assert for ImportC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Thursday, 28 April 2022 at 04:33:18 UTC, Walter Bright wrote: >I put in a PR to add __assert(assign-expression) to ImportC, for reasons explained in the PR: https://github.com/dlang/dmd/pull/14026 Unfortunately, some C compilers use __assert. Arghh! I seem unable to come up with a decent name. Advice welcome! maybe it almost looks like something you could expect to see in a future C standard adding a prefix to the double-underscore name would be the safe but boring option, something like |
April 28, 2022 Re: Asking for advice - assert for ImportC | ||||
---|---|---|---|---|
| ||||
Posted in reply to rikki cattermole | On 4/27/2022 9:36 PM, rikki cattermole wrote:
> Do we really need to be introducing our own unique extensions for C that can introduce new conflicts later on?
No, we don't have to do this. But it makes the ImportC test suite a lot more convenient.
|
April 28, 2022 Re: Asking for advice - assert for ImportC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Thursday, 28 April 2022 at 08:05:22 UTC, Walter Bright wrote: >No, we don't have to do this. But it makes the ImportC test suite a lot more convenient. If it's about test suite convenience, you don't need a new language feature. You can define your own assert template and import it in tests that need it. If manually importing it is too inconvenient as well, you can modify the test suite runner to add the import statement, or add it to __builtins.di under a version condition that's set in the test suite. |
April 29, 2022 Re: Asking for advice - assert for ImportC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dennis | On Thursday, 28 April 2022 at 08:29:41 UTC, Dennis wrote: >On Thursday, 28 April 2022 at 08:05:22 UTC, Walter Bright wrote: >No, we don't have to do this. But it makes the ImportC test suite a lot more convenient. [...] you can modify the test suite runner to add the import statement, or add it to __builtins.di under a version condition that's set in the test suite. Although I don't understand it technically (what are DI files?), I support Dennis's opinion but I care about ImportC... And please do whatever is necessary to make it easier. SDB@79 |
April 29, 2022 Re: Asking for advice - assert for ImportC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Salih Dincer |
On 29/04/2022 2:24 PM, Salih Dincer wrote:
> Although I don't understand it technically (what are DI files?),
.di files are like regular .d files except by convention non-templated functions have their bodies removed.
|
April 29, 2022 Re: Asking for advice - assert for ImportC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Salih Dincer | On Friday, 29 April 2022 at 02:24:12 UTC, Salih Dincer wrote: >Although I don't understand it technically (what are DI files?), |