Had another 48hr game jam this weekend...

Dicebot public at dicebot.lv
Mon Sep 2 06:25:17 PDT 2013


On Monday, 2 September 2013 at 12:54:41 UTC, Simen Kjaeraas wrote:
> If you want the definition in a different file, and no class 
> Foo { in the
> implementation file, you can do this:
>
> // foo.d
> class Foo {
>     // Forbles the grabblies.
>     void bar();
>
>     import("foo_imp.d");
> }
> ----------------------------
> //foo_imp.d:
>
> bar() {
>     myGrabblies.forble();
> }
>
> That gives no inline indication of which class the functions 
> belong to,
> though. Also, no global functions in foo_imp.d.

That is pretty fun trick but it is so preprocessor-flavored! :( 
Also it is likely to confuse lot of semantic analysis tool. Still 
may be a viable hack.


More information about the Digitalmars-d mailing list