-
-
Notifications
You must be signed in to change notification settings - Fork 28
Description
-
#+packageat the start of the file will mark any defined symbol as thepackageonly scope. A file defined with#+packageflag can use#localflag for scoping at thefilelevel for individual symbols. -
#+localat the start of the file will mark any defined symbol as thefileonly scope. A file defined with#+localflag can use#packageflag for scoping at thepackagelevel for individual symbols.
A file with flags #+package or #+local cannot make its symbols public in any way. Another public file should be created.
Motivation
By using a file level fiag we can separate our APIs with public and private (package and file only) scopes, and avoid saturating our public files and symbols with scope attributes.
Example
By using this flag we can cleary separate scopes in our package.
- api.onyx // public apis
- api.pkg.onyx // package scope apis
- api.local.onyx // file (local) scope apis
Syntax
It was preferred the syntax #+ instead of //+ since it has less characters and promotes the meaning of a compiler directive instead of a comment.