The missing bit in DIP1000

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Thu Jun 23 10:39:13 UTC 2022


On Thursday, 23 June 2022 at 10:17:44 UTC, rikki cattermole wrote:
> I like it.
>
> It solves non-nullable types and scope as a type constructor.
>
> Although I do hope it wouldn't require more syntax than adding 
> a single new type constructor.

You don't necessarily need to add syntax for it, just "think" 
about it this way so you end up with something consistent and 
later can add ful flow typing if that turns out to be a good 
idea. (Flow typing should work very nicely with meta-programming, 
but for some reason most languages that provide flow typing does 
not have meta programming!! :-D Although I guess C++ concepts is 
indirectly hinting at this combination being fruitful.)

I think you also would need to have «returnscope(int)» which 
would be a subtype of «scope(int)» ( returnscope <: scope ), but 
I haven't really gone over it, so maybe I am wrong. Is it safe to 
put a returnscope type everywhere you would accept a scope type? 
If yes, then we are good.



More information about the Digitalmars-d mailing list