Simple Tip: Defining a type from a different namespace.

4 views
Skip to first unread message

emp...@gmail.com

unread,
Apr 25, 2009, 4:12:54 AM4/25/09
to Nemerle Forum
Hello,

May be it's something you already know but I'd like to share it
nevertheless.
In case you need to define a type from a different namespace you would
do :

macro BuildClass ()
{

def man = Nemerle.Macros.Manager();

def z = man.CoreEnv.EnterIntoNamespace(["SomeOtherNameSpace"]);

def builder = z.Define (<[ decl:
internal class FooBar
{
public static SomeMethod () : void
{
System.Console.WriteLine ("Hello world");
}
}
]>);

builder.Compile ();

<[() ]>

That is of course from root level. My 2 cents.
Reply all
Reply to author
Forward
0 new messages