Open Methods: From C++ to D

Atila Neves via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Thu Aug 31 06:30:27 PDT 2017


On Thursday, 31 August 2017 at 11:39:30 UTC, aberba wrote:
> On Thursday, 31 August 2017 at 10:30:38 UTC, Atila Neves wrote:
>> On Wednesday, 30 August 2017 at 04:48:11 UTC, Arun 
>> Chandrasekaran wrote:
>>> On Tuesday, 29 August 2017 at 12:45:50 UTC, Jean-Louis Leroy 
>>> wrote:
>>>> On Tuesday, 29 August 2017 at 12:09:01 UTC, Mark wrote:
>>>>> Nice. This does seem superior to the visitor pattern.
>>>>
>>>> Here is another example - AST traversal: 
>>>> https://github.com/jll63/openmethods.d/blob/master/examples/acceptnovisitors/source/app.d
>>>
>>> Thanks for this library. Just a suggestion. Would it possible 
>>> to use `@openmethod` instead of `@method`?
>>
>> alias openmethod = method;
>>
>> Atila
>
> What happens when there is UDA name collision? if its 
> catastrophic, then @openmethods makes it unique.

import otherpackage: funkyMethod = openmethod;
import openmethod: openmethod = method;

Or use the fully qualified name. Either way, nothing that can't 
be dealt with by D's modules as they are now.


Atila


More information about the Digitalmars-d-announce mailing list