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

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -