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

Rename builtin and core module functions #150

Open
ThakeeNathees opened this issue Jun 28, 2021 · 0 comments
Open

Rename builtin and core module functions #150

ThakeeNathees opened this issue Jun 28, 2021 · 0 comments
Labels
good first issue Good for newcomers

Comments

@ThakeeNathees
Copy link
Owner

ThakeeNathees commented Jun 28, 2021

BREAKING CHANGE -- Till the first release, it's most likely to change everything with compatibility breaks.

Discuession

Currently, pocketlang doesn't have any naming convention, and every symbol is snake_case. We need to enforce a naming convention for consistency across the builtin functions and core modules. And I'd like it to match our C implementation.

  • Function names are camelCase

  • Variable names/attributes are snake_case

  • Class names are PascalCase

  • Modules intended to used as a collection of functions (ex math, path) - snake_case

  • Modules intended to used as a type wrapper (ex File, Fiber) - PascalCalse

How to rename

  • You can find all the builtin functions, core module and its functions at src/pk_core.c Here (ex: to_string -> toString)

  • The additional cli modules at cli/modules.c

Finally

  • This requires you to rename all the test suites in tests/ directory for the tests to be passed
  • Check docs at docs/pages/Getting-Started/learn-in-15-minutes.md if any functions need renaming.

If you have any suggestions, regarding the renaming let me know.

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

No branches or pull requests

1 participant