is(x = module) vs. __traits(isModule, x)
Stefan Koch
uplink.coder at googlemail.com
Sun Oct 11 11:48:23 UTC 2020
On Sunday, 11 October 2020 at 11:30:00 UTC, Nick Treleaven wrote:
> On Thursday, 8 October 2020 at 13:04:18 UTC, Stefan Koch wrote:
>> On Thursday, 8 October 2020 at 12:54:49 UTC, Adam D. Ruppe
>> wrote:
>>> I kinda wish we had a template lambda.
>>
>> you mean alias compiles (__top A) = ((__top x) =>
>> __traits(compiles, x)(A); ?
>
> Not sure what __top is, but the compiles trait is special in
> that it can't be wrapped in a template (it's not really a trait
> of a symbol or expression like its type, but a deeper semantic
> analysis of an expression).
>
> 'Template lambda' is really anonymous templates:
> enum(alias Sym) => __traits(isModule, Sym)
__top is the top type.
that which can hold anything.
symbols, complete expressions, types, values, tuples.
anything.
More information about the Digitalmars-d
mailing list