2 ms·
Does Nim have (or plan to have) (non-)nullable types?
by vesak 8y ago
Does Nim have (or plan to have) (non-)nullable types?
- hathawsh 8y agoPointers in Nim can have the "not nil" annotation. The annotation is checked by the compiler.
- PMunch 8y agoWith 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.