October 08, 2022

On Saturday, 8 October 2022 at 17:27:58 UTC, Nick Treleaven wrote:

>

On Saturday, 8 October 2022 at 17:09:39 UTC, FeepingCreature wrote:

>

Yeah okay so it's definitely possible, but I do feel it's kinda questionable to call barely documented internal implementation-dependent (?) runtime functions from user code...

What's missing from the docs?
Besides object there's also the AA docs:
https://dlang.org/spec/hash-map.html#inserting_if_not_present

Which, again, doesn't work with immutable types...

October 08, 2022

On 10/8/22 1:09 PM, FeepingCreature wrote:

>

On Friday, 7 October 2022 at 20:04:48 UTC, Steven Schveighoffer wrote:

>

On 10/7/22 3:20 PM, FeepingCreature wrote:

>

Yeah, if I could get the associative array to give me a pointer to an uninitialized value for a key, that would do it, I think.

Have you looked at the implementation for require? That's exactly what it does.

For reference: https://github.com/dlang/dmd/blob/f4c21ccd6a73fee7abdea39cc38e8c64b627ffe1/druntime/src/object.d#L3457

Yeah okay so it's definitely possible, but I do feel it's kinda questionable to call barely documented internal implementation-dependent (?) runtime functions from user code...

Perhaps you misunderstand -- I think druntime's require should be updated to make this work.

-Steve

October 08, 2022

On Saturday, 8 October 2022 at 20:58:09 UTC, Steven Schveighoffer wrote:

>

On 10/8/22 1:09 PM, FeepingCreature wrote:

>

On Friday, 7 October 2022 at 20:04:48 UTC, Steven Schveighoffer wrote:

>

Have you looked at the implementation for require? That's exactly what it does.

For reference: https://github.com/dlang/dmd/blob/f4c21ccd6a73fee7abdea39cc38e8c64b627ffe1/druntime/src/object.d#L3457

Yeah okay so it's definitely possible, but I do feel it's kinda questionable to call barely documented internal implementation-dependent (?) runtime functions from user code...

Perhaps you misunderstand -- I think druntime's require should be updated to make this work.

-Steve

Oh! Yeah, that seems like it should be viable.

1 2
Next ›   Last »