Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Thorrez
50 days ago
|
parent
|
context
|
favorite
| on:
John Carmack on mutable variables
You can make everything read-only by default, and if you need non-read-only, you use "mutable".
alcover
50 days 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
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: