-
Notifications
You must be signed in to change notification settings - Fork 4
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
A way to mark symbols as private #84
Comments
I think on the contrary, you can use the "extern" keyword to decide which functions need to be exported. |
def internal_util_function() -> int:
return 123
static struct PrivateStruct:
x: int
y: int
extern def public_function() -> int:
return internal_util_function() * 2
extern struct PublicStruct:
message: byte*
line: int |
So basically, everything is private by default, and you can use a keyword like I think I will probably name the keyword
|
More possible keywords to use for this:
|
|
I think |
|
It seems that everyone is happy with |
How about a decorator? @public
def add(x: int, y: int) -> int:
return x + y |
I like that, but if it isn't written in Jou that would feel a bit too automagic-y for a decorator. |
Currently all functions and structs are made available for other files to import. There should be a way to make functions and structs be visible only within the current file.
Maybe
static
?The text was updated successfully, but these errors were encountered: