Skip to content
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

const is not about types #34

Open
JeffBezanson opened this issue Aug 3, 2018 · 1 comment
Open

const is not about types #34

JeffBezanson opened this issue Aug 3, 2018 · 1 comment

Comments

@JeffBezanson
Copy link

The WhyJulia page states that "const is about types, it acts slightly differently than one would expect. const is a declaration that the type of a will be constant, not the value". This is completely false. The compiler indeed assumes that constants will not change value. This is why we print a warning. We don't just print warnings for the hell of it; if you see a warning something is definitely wrong. In this case your program could break in all kinds of ways, but we allow it for convenience to reduce the need to restart julia.

@ChrisRackauckas
Copy link
Member

Yes, I was wrong about this 2 years ago and haven't changed it. Some old blog posts might have this too. I'll get this fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants