Null object: Difference between revisions
Content added Content deleted
No edit summary |
(→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)") |
||
Line 2,170: | Line 2,170: | ||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|Vlang}}== |
=={{header|V (Vlang)}}== |
||
Vlang does not have nor normally allow null or nil (also called "the billion dollar mistake"): |
V (Vlang) does not have nor normally allow null or nil (also called "the billion dollar mistake"): |
||
1) All primitive types/variables have default values. |
1) All primitive types/variables have default values. |
||
Line 2,178: | Line 2,178: | ||
3) Usage of voidptr or nil, only done in unsafe, and is usually only for the purposes of interoperability with other languages. |
3) Usage of voidptr or nil, only done in unsafe, and is usually only for the purposes of interoperability with other languages. |
||
<syntaxhighlight lang="vlang"> |
<syntaxhighlight lang="v (vlang)"> |
||
// Null or nil not used, default values for various primitive types/variables instead: |
// Null or nil not used, default values for various primitive types/variables instead: |
||