Is it possible to use dynamic typing?

Mar 28, 2014 at 4:52 PM
Is it possible to use dynamic typing between C# & Lua Script ?
For example :

C# Code :
    public static void TestDyn(dynamic objElement, string value)
    {
        if (objElement != null) { objElement.display(value); }            {
    }

    LuaGlobal lg = l.CreateEnvironment();
    dynamic g = lg;
    g.TestDyn = new Action<dynamic, string>(TestDyn);

Lua Script :
    TestDyn(?????, "Test NeoLua");
Coordinator
Mar 28, 2014 at 7:06 PM
Yes, because the type dynamic does not exist. It is something like a markup for the compiler to generate the CallSiteBinder at the position.

That is the reason, why you can write this:
    public static void TestDyn(dynamic objElement, string value)
    {
      if (objElement != null) 
        objElement.display(value); 
    }

    g.test = new Action<object, string>(TestDyn);
Thx, for the first discussion thread.
Marked as answer by PapyRef on 4/3/2014 at 8:44 AM