Reimplementing the bulk of std.meta iteratively

Bruce Carneal bcarneal at gmail.com
Thu Oct 1 13:46:32 UTC 2020


On Thursday, 1 October 2020 at 07:51:28 UTC, Timon Gehr wrote:
> 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;

Yes.

The common understanding of a "statically typed language" is 
quite a bit more restrictive than "anything which can be 
determined from a fixed 'source' input" yet that is the bounding 
condition, it seems, for "static" compilation.

I lack the terminology to discuss this succinctly so I asked.  
Note, my lack of understanding is sufficient that I may not have 
posed a well formed question.  Illumination is requested.





More information about the Digitalmars-d mailing list