Alpha renaming in types is finally here

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 8 09:23:30 PDT 2015


On 6/8/15 5:43 AM, Timon Gehr wrote:
> On 06/08/2015 09:51 AM, Andrei Alexandrescu wrote:
>> I've been wondering for a good while whether it's possible with what we
>> have. Looks like it is, modulo some gnarly hacks in introspecting
>> function types.
>>
>> https://github.com/D-Programming-Language/phobos/pull/3394
>>
>>
>> Destroy!
>>
>> Andrei
>
> - This is not alpha renaming. Alpha renaming renames a variable at the
> point it is bound and updates all occurrences of the variable. Alpha
> renaming does not change the term it is applied to.
> http://en.wikipedia.org/wiki/Lambda_calculus#.CE.B1-conversion
>    This is type replacement.

I'm using the term a bit loosely but I think appropriately.

> - How do you use it to create recursive types using algebraic? (Assuming
> that's what your comment refers to.)

I've added documentation and examples to 
http://erdani.com/d/phobos-prerelease/std_variant.html#.Algebraic. 
Feedback appreciated.


Thanks,

Andrei



More information about the Digitalmars-d mailing list