Recursive data-types
thedeemon via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat Sep 27 10:49:52 PDT 2014
On Saturday, 27 September 2014 at 11:40:19 UTC, Rikki Cattermole
wrote:
>> These definitions can't work since Function and Atom need each
>> other in
>> this recursive definition.
>>
>> How to get out of this trap?
>> Do I have to drop Algebraic and go back to manual tagged
>> unions?
>
> Converting Function to a class. No where near ideal. But it'll
> work.
Interesting, I didn't expect this to work...
Got a longer workaround using some category theory and higher
kinded types:
http://www.infognition.com/blog/2014/recursive_algebraic_types_in_d.html
More information about the Digitalmars-d-learn
mailing list