Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentiating engine and user functions #7

Open
sunarch opened this issue Dec 14, 2022 · 2 comments
Open

Differentiating engine and user functions #7

sunarch opened this issue Dec 14, 2022 · 2 comments

Comments

@sunarch
Copy link
Contributor

sunarch commented Dec 14, 2022

I did not want to PR this until I get your opinion:

I believe it would be useful to differentiate the source of Lua functions with a prefix:

  • Functions exposed from scripts.c could be e for engine or k for KIAVC, e.g. eShowObject.
    • Some of them already have a kiavc prefix, e.g. kiavcRequire and logging.
  • Functions from scripts in the lua/engine folder could be c for collection or e if not taken above.
    • I think engine could be misleading here, so e above and c for this, which is better also in that they are both one-high letters, unlike k.
@lminiero
Copy link
Owner

Mh I'm not a big fan of the idea, to be honest: it may cause the name of functions to quickly explode in length. I'm not sure I understand the reference to collections, though?

@sunarch
Copy link
Contributor Author

sunarch commented Dec 15, 2022

That's why I was only suggesting one letter, so that it doesn't make it much longer. But I understand you skepticism. It's only an idea, anyway.

"Collection" is just a possibility I came up with for the scripts in the lua/engine folder. I already used e for the functions exposed by the C engine code, so that's why I needed something else.

But it works the other way too: cFunction for functions exposed by the C code, and eFunction for functions in Lua that are shipped with the engine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants