Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> you don't need both a "const" keyword and a "mutable" keyword

What if the lang has pointers? How express read-only?



You can make everything read-only by default, and if you need non-read-only, you use "mutable".


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


compiler flags with line and column number seems like the easiest way




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: