properties - Lua variable as a function call -


i need define variables in lua when accessed result in call of c++ function:

lua: var rootname = root.name; // 'root' acts call c++ function defined below  c++: class node {     std::string name; }  node * root() {    return mynodegraph->getroot(); } 

is possible in lua?

yes can that. that's acutally 1 of common use cases of lua. although proper lua syntax local = prop() if want 5.

read https://www.lua.org/manual/5.3/ , https://www.lua.org/pil/24.html https://www.lua.org/pil/25.html https://www.lua.org/pil/26.html


Comments

Popular posts from this blog

cron - how to properly run Python script with crontab on every system startup -

elasticsearch - Is the order of operations guaranteed in a bulk update? -

Slow performance first queries on SQL Azure -