-
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
Global constants #369
Comments
Maybe |
Why is it not a good idea to use a long keyword? An advantage with We could also try |
Just think long keyword will make people feel annoying. |
I think |
I think so. |
Today I tried generating some Jou code with AI mostly for fun, and to see what it would do. (This usually doesn't work very well, see doc/ai-thoughts.md.) The AI guessed/used the following syntax: # Constants
const RAND_MAX: int = 2147483647 # Maximum value for rand() |
In C you would use
#define
to create constants. What should be the recommended way in Jou? Should we add new syntax, something likeglobalconstant FOO = 1
?I think currently the best you can do is a function that returns the value, because global variables cannot have an initial value yet. This is actually what
config.jou
does (see the Makefiles).The text was updated successfully, but these errors were encountered: