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

Why not const by default? #152

Open
porky11 opened this issue Nov 24, 2016 · 2 comments
Open

Why not const by default? #152

porky11 opened this issue Nov 24, 2016 · 2 comments

Comments

@porky11
Copy link
Contributor

porky11 commented Nov 24, 2016

When declaring varialbes you normally don't declare it const, and it's normally never necessary.
When variables have to be declared mutable explicitly errors may be found more easily.
This wouldn't be as in C. Is it important, that the language is like C, even if some other design may be better?

@porky11
Copy link
Contributor Author

porky11 commented Nov 25, 2016

const by default could also be implemented by macros, but this may be difficult, becuase it's not clear, where we have types and where not, expecially for more complicated types like (array-of 2 int) (which should not expand to (const (array-of (const 2) (const int))) if they are not defined as mutable) or most concept-macro types

@BitPuffin
Copy link

I agree on this. Sounds better to me to have explicit mutability.

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