top | item 45771571 (no title) alcover | 4 months ago > you don't need both a "const" keyword and a "mutable" keywordWhat if the lang has pointers? How express read-only? discuss order hn newest Thorrez|4 months ago You can make everything read-only by default, and if you need non-read-only, you use "mutable". alcover|4 months ago You need two keywords. One for assignability and one for writability : const ptr; // can't reassign, can't write-through (if r/o by default) const mut ptr; // can write skeezyjefferson|4 months ago compiler flags with line and column number seems like the easiest way
Thorrez|4 months ago You can make everything read-only by default, and if you need non-read-only, you use "mutable". alcover|4 months ago You need two keywords. One for assignability and one for writability : const ptr; // can't reassign, can't write-through (if r/o by default) const mut ptr; // can write
alcover|4 months ago You need two keywords. One for assignability and one for writability : const ptr; // can't reassign, can't write-through (if r/o by default) const mut ptr; // can write
Thorrez|4 months ago
alcover|4 months ago
skeezyjefferson|4 months ago