Reimplementing the bulk of std.meta iteratively

Timon Gehr timon.gehr at gmx.ch
Thu Oct 1 07:51:28 UTC 2020


On 01.10.20 07:37, Bruce Carneal wrote:
> On Wednesday, 30 September 2020 at 23:17:27 UTC, Timon Gehr wrote:
>> On 29.09.20 01:37, Stefan Koch wrote:
>>> ...
>>
>> It's not a first-class type if you can't declare a variable of that 
>> type. If this does not work, it's not first-class, it's syntax sugar 
>> for reification:
>>
>> type t = int;
>> auto f = (t x)=>x;
> 
> Can anything computable using just the source as input be considered a 
> first class type?
> 
> If so, what do we call type variables that can not be?
> 

Unfortunately I am not sure understand the question. What is an example 
of a "type variable that cannot be computed using just the source"? 
(Which source?)

Maybe this is related to what you mean?

type t = readln().strip()=="int"?int:double;
auto f = (t x)=>x;


More information about the Digitalmars-d mailing list