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

This is common behavior for languages. D adds another wrinkle to it - a reference can be mutable, const, or immutable.

mutable: can modify it

const: cannot modify it through the reference, but other mutable references can still modify it

immutable: nobody can modify it

The 'immutable' is great for writing threaded code, as no synchronization is necessary.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: