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

Does Nim have (or plan to have) (non-)nullable types?


With version 0.19.0 Nim also moved away from nilable seqs and strings, so they are much safer to use. An empty string and a nil string is now the same, and a nil seq and a seq without elements is the same. Saves you from that one missing nil check that crashes your entire program.

If you want the behaviour of nilable seqs and strings you can use the options module.


Pointers in Nim can have the "not nil" annotation. The annotation is checked by the compiler.




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

Search: