Nasal/CppBind: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 62: Line 62:
naRef initNasalTest(naRef globals, naContext c)
naRef initNasalTest(naRef globals, naContext c)
{
{
     NasalTest::init("Test")
    // This only needs to be called once for each ghost
                 .method("hello", &Test::hello);
     NasalTest::init("Test") // this is the ghost's symbol used in error messages/diagnostics
                 .method("hello", &Test::hello); // add a method to the ghost and map it to the method in the struct/class


     // set up a  new namespace for our functions
     // set up a  new namespace for our functions
Line 85: Line 86:
   print t[e];
   print t[e];


e.hello();
</syntaxhighlight>
</syntaxhighlight>


Navigation menu