-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
get rid of zeroes #222
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
Comments
if anyone has examples of use cases for zeroes literal, please post them here and I'll make sure there is a suggested alternative way to solve that use case. |
Not sure its a correct, good or valid use case, but I had this...(diff)
Which now gives this error message.
|
ah ok there was another change here. it used to be that the variable declaration syntax would do
The const mem = @import("std").mem;
mem.set(usize, column, 0); Is the compiler correct that |
Aye, The
|
Yeah, seems kind of weird that you can write through What's going on is that the concept of "const" is referring to memory range. When you have a const variable, the memory range that contains the variable cannot be changed through that variable. When you have a pointer, the pointer address itself exists in memory too, and that can be const or not, and then the memory range the pointer points to can be const or not. That's why we have So in this example It works with So it makes sense, but it's still confusing that you can write through a const. So I think this is an argument in favor of using Be careful with that globalarray code because that causes problems with thread safety and re-entrancy safety. |
No description provided.
The text was updated successfully, but these errors were encountered: