Little demo of allowing basic types to implement interfaces.
rjmcguire at gmail.com
Wed Sep 4 01:55:52 PDT 2013
So the general idea would be to add:
mixin("import "~ mod ~";");
into the check() inner function but mod needs to come from somewhere.
I haven't been able to make it as a template yet.
A template should get evaluated in the calling context.
On Wed, Sep 4, 2013 at 10:44 AM, Rory McGuire <rjmcguire at gmail.com> wrote:
> yes, it does seem to break if the Implements template func is in a
> different module to the free standing func.
> hmph, how to get around that.
> On Wed, Sep 4, 2013 at 9:04 AM, Tobias Pankrath <tobias at pankrath.net>wrote:
>> On Wednesday, 4 September 2013 at 00:56:55 UTC, Rory McGuire wrote:
>>> I was wondering if its possible to do interfaces the way #golang does it
>>> but in #dlang.
>>> Here is my first try: https://gist.github.com/**rjmcguire/6431542<https://gist.github.com/rjmcguire/6431542>
>>> Any help on making this smaller would be awesome.
>> Will this break, if I implement the free standing functions in a
>> different module that is not in scope of the Implements! template?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Digitalmars-d-announce