Jump to page: 1 2 3
Thread overview
Asking for advice - assert for ImportC
Apr 28, 2022
Walter Bright
Apr 28, 2022
rikki cattermole
Apr 28, 2022
Walter Bright
Apr 28, 2022
Dennis
Apr 29, 2022
Salih Dincer
Apr 29, 2022
rikki cattermole
Apr 29, 2022
Loara
Apr 29, 2022
Ali Çehreli
Apr 29, 2022
Guillaume Piolat
Apr 29, 2022
Mike Parker
Apr 29, 2022
Adam D Ruppe
Apr 29, 2022
Dennis
Apr 29, 2022
Adam D Ruppe
Apr 29, 2022
rikki cattermole
Apr 29, 2022
Mike Parker
Apr 28, 2022
Daniel N
Jul 16, 2022
Era Scarecrow
Apr 28, 2022
Salih Dincer
Jul 09, 2022
Salih Dincer
Apr 28, 2022
duser
Apr 29, 2022
Walter Bright
Apr 30, 2022
zjh
Apr 30, 2022
Ali Çehreli
April 27, 2022
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
Do we really need to be introducing our own unique extensions for C that can introduce new conflicts later on?
April 28, 2022
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

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

April 28, 2022

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 _Assert? similar to _Static_assert

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 __d_assert or __importc_assert

April 28, 2022
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

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

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
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

On Friday, 29 April 2022 at 02:24:12 UTC, Salih Dincer wrote:

>

Although I don't understand it technically (what are DI files?),

https://dlang.org/dmd-linux.html#interface_files

« First   ‹ Prev
1 2 3