<div dir="ltr"><div><div>I have a basic solution but it can't handle basic types LOL! you have to typedef them so that moduleName!T works.<br><br></div>and then the functions  have to be declared in the same module as the type. Or alternatively you have to specify the module to use e.g. Implements!(T,MyInterface, "mymodule").<br>

<br><a href="http://dpaste.dzfl.pl/cff0ca5a">http://dpaste.dzfl.pl/cff0ca5a</a><br><br></div>I had to hard code the module name because dmd segfaults if you use __MODULE__ in the contraint. Both references to asdf should be changed to the module you are using.<br>
<div><br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 4, 2013 at 11:48 AM, Rory McGuire <span dir="ltr"><<a href="mailto:rjmcguire@gmail.com" target="_blank">rjmcguire@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thanks, the exact example is exceptions. Was working really late the day that it wasn't working :D my bad. The following is what I was after, which I really thought I had tried.<br>
<br>class BaseException : Exception {<br>
    this(string s="", string file = __FILE__, int line = __LINE__) {<br>        super(s, file, line);<br>    }<br>}<br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Sep 4, 2013 at 11:33 AM, Dicebot <span dir="ltr"><<a href="mailto:public@dicebot.lv" target="_blank">public@dicebot.lv</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Wednesday, 4 September 2013 at 09:23:44 UTC, Rory McGuire wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
thanks, yes, I just found that in TDPL. knew it was templates but forgot<br>
about template mixins.<br>
<br>
Do you know how to get a default parameter like __MODULE__ or __LINE__ to<br>
be used from the calling site?<br>
I've tried but I think my DMD is broken because it doesn't even work when I<br>
subclass Exception().<br>
</blockquote>
<br></div>
Special tokens like __LINE__ in default parameters are evaluated at the call site: <a href="http://dpaste.dzfl.pl/f7b9dfcf" target="_blank">http://dpaste.dzfl.pl/f7b9dfcf</a><br>
<br>
It does not help though, because you don't need __MODULE__ of the call site, you need list of modules it has imported in exact call scope.<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>