Content deleted Content added
(1) The common type of struct examples redone (2) Rewording with references |
Redo of error handling example |
||
Line 141:
Optional types are for types which may represent none. Result types may represent an error returned from a function.
Option types are declared by prepending {{code|?}} to the type name: {{code|?Type}}. Result types use {{code|!}}: {{code|!Type}}.<ref name="Knott"/><ref name="section"/>{{Sfn|Tsoukalos|2022}}
<syntaxhighlight lang="V">
fn
if
return error("invalid string")
}
println(
println(
</syntaxhighlight>
|