Discussion Thread: DIP 1037--Add Unary Operator ...--Community Review Round 1

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Sun Nov 1 22:11:14 UTC 2020


On Sunday, 1 November 2020 at 21:47:26 UTC, Manu wrote:
> Why? I don't agree with this at all. I actually expect tuples 
> DON'T have struct semantics.

Well, it is a good thing if they behave as immutable structs as 
you then can get a more uniform language.

> The thing my DIP talks about are things that don't have struct 
> semantics...
> what is that called?

I was wrong, in a way, as structs can have aliases as fields (I 
believe phobos Tuple does this?). Although it would be better if 
it was more akin to typeid so that they had a counterpart at 
runtime (so that a regular function can return all tuples), but 
that would require a language change.

But it would also make what Stephan try to do easier? His 
typefunctions would just be regular functions returning a 
type-identifer.

> Make a DIP then. I don't like that idea. It's problematic to 
> know if you are dealing with a kind of thing that can be 
> unrolled until much later in semantic when it should have 
> already been done.

The semantic passes can determine when the operator should be 
evaluated.




More information about the Digitalmars-d mailing list