Closed doing-fine-thanks closed 3 months ago
There's nothing to do with Sol here; it just needs to use strings for the table keys:
(print (. (. (: CameraManager getInstance) camera) zoom))
This should be rewritten as
(print (. (CameraManager:getInstance) :camera :zoom))
In general you can use https://fennel-lang/see to convert a given piece of Lua into Fennel. The other example would look like this:
(tset (. (CameraManager.getInstance) :camera) :zoom 10)
Ah, my bad! thank you so much (the conversion tool is immensely helpful).
feel free to tag as "error-between-keyboard-and-chair."
Haha cool. Have fun!
Hi folks,
I am admittedly a very new Fennel user and also a very new Lua user, so I might be missing something pretty basic. Currently I am trying to add a lisp scripting layer to a C++ game engine and decided to you Sol for the Lua bindings. Currently nested object access works on the Lua side of things:
but on the Fennel side I get errors related to unknown identifiers:
It seems to work to use the multisym syntax and go one struct depth at a time, but that make the code feel pretty cumbersome:
For references I am binding the c++ code through Sol like this:
Even if I try the polish-notated object access going step by step, the program still errors when trying to find identifiers.
Sorry if I am missing something obvious and thank you in advanced!