You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#+package at the start of the file will mark any defined symbol as the package only scope. A file defined with #+package flag can use #local flag for scoping at the file level for individual symbols.
#+local at the start of the file will mark any defined symbol as the file only scope. A file defined with #+local flag can use #package flag for scoping at the package level 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.
I think this is a great idea! I have designed many APIs like this where I have one "public" file, and many internal implementation files. I'm unsure if I like #+package, because every other directive so far is always # + a symbol. But I will have to think about what other wording it could be, as #package would be ambiguous.
#+package
at the start of the file will mark any defined symbol as thepackage
only scope. A file defined with#+package
flag can use#local
flag for scoping at thefile
level for individual symbols.#+local
at the start of the file will mark any defined symbol as thefile
only scope. A file defined with#+local
flag can use#package
flag for scoping at thepackage
level 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.
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.The text was updated successfully, but these errors were encountered: