www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - What's the state of std.experimental.typecons.{wrap/unwrap} ?

reply sighoya <sighoya gmail.com> writes:
Link to page: 
https://dlang.org/phobos/std_experimental_typecons.html

I'm very interested in auto wrapping of structs/classes to 
interfaces as it would aid to close the gap of structs to classes 
regarding interface conformity.
Further, it would allow D to strive for the route of existentials 
(a.k.a. boxes) as duality to generics/templates.
In the end, it would help D to become much more uniform, I think.

What's the actual the state of structural wrapping/unwrapping?

There are further things which irk me a bit:

If Source is a struct then wrapping/unwrapping will create a 
copy; it is not possible to affect the original struct through 
the wrapper.
I would expect this to be the case. However, what about ref structs, can they be supported, too?
Source can be either a class or a struct,
Why not interfaces, too?
allSatisfy!(isInterface, Targets)
Why not classes, too?
May 20
parent reply Jesse Phillips <Jesse.K.Phillips+D gmail.com> writes:
On Thursday, 20 May 2021 at 20:19:47 UTC, sighoya wrote:
 Link to page: 
 https://dlang.org/phobos/std_experimental_typecons.html

 [...]

 What's the actual the state of structural wrapping/unwrapping?
Sorry about this, it has stalled because it is really hard to work outside the actual std.typecons. As I started digging into issues with wrapping range interfaces, I started needing more and more private methods, basically copying in all of typcons. Then it got worse, some of the methods needed a change in how they interpreted the type. These changes may make sense for the original or maybe not, either way maintaining this second concept while expecting a need to merge back into std.typecons became a mental roadblock on how to manage it all. I'm probably in a better mental state now and could push for changes in std.typecons, but in the meantime I got married with children and don't really do hobby programming (at least not with the multi-day mental concentration this would require).
May 20
parent reply sighoya <sighoya gmail.com> writes:
On Friday, 21 May 2021 at 01:02:22 UTC, Jesse Phillips wrote:
 Sorry about this, it has stalled because it is really hard to 
 work outside the actual std.typecons.
No excuse required, it is ok. I'm happy it's still on plan.
May 21
parent Jesse Phillips <Jesse.K.Phillips+D gmail.com> writes:
On Friday, 21 May 2021 at 11:11:08 UTC, sighoya wrote:
 On Friday, 21 May 2021 at 01:02:22 UTC, Jesse Phillips wrote:
 Sorry about this, it has stalled because it is really hard to 
 work outside the actual std.typecons.
No excuse required, it is ok. I'm happy it's still on plan.
Well, it's been stalled for years. I really like the concept, but maybe your interest will motivate me to find new ways to incrementally move forward.
May 21