ImportC now supports function-like macros
Jonathan M Davis
newsgroup.d at jmdavisprog.com
Sun Mar 3 03:05:00 UTC 2024
On Saturday, March 2, 2024 12:01:40 PM MST Walter Bright via Digitalmars-d
wrote:
> The trouble is that D's semantic code simply does not support non-transitive
> const, this is worked fundamentally into the type system. Any other method
> I can think of is going to have seams and warts.
Honestly, given C's semanticts for const, I'm tempted to argue that it isn't
even correct to treat anything as const when passing it to extern(C)
functions. Ultimately, it's an @system thing, because D's type system
guarantees aren't in place, but fundamentally, if you pass a const pointer
to C from D, you're not getting any actual promises about it - to the point
that you're effectively casting it to mutable when passing it.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list