Files
ground/docs/library-guide.md
2025-08-25 14:10:14 +10:00

22 lines
1016 B
Markdown

# Guide to Writing Libraries in Ground
Ground has a "use" keyword which allows you to import libraries written in Ground, executing the code, and importing functions for use. This makes building reproducable bits of code very easy.
This is a guide of best practices which should be followed.
## .grnd file extension
The Ground interpreter will automatically append ".grnd" when you use a library. If you write `use "myLibrary"` Ground will look for "myLibrary.grnd". This is a must-do.
## camelCase Function and File Names
For consistency, please use camelCase (with a lower case first letter) when naming functions and file names.
## Don't use spaces
It is impossible to use spaces in Ground function names. Please do not use spaces in file names, even though it will work.
## Use functions for most operations
Where possible, create functions to do everything needed with your library. You can include some code for initialisation, but don't do the entirety of your operations outside of your functions.