Void in Verse
In addition to the standard types in Verse, there are some additional constructs that can be used the way you would use a type, but that technically are not types. void is one such construct.
When used as the result of a function, it indicates that the function can return any value, but when invoked, it will provide no particular result of interest.
Void takes any value and returns false. This allows the body of a function that returns void to implicitly yield any value, without having to be careful to convert the result of any last expression in a block.
For example:
Foo() : void = {}
Foo() : void = {}
Copy full snippet(1 line long)
This means that Foo will succeed, but will not return a value.
For example:
FirstInt(X:int, :void) : int = X
FirstInt(X:int, :void) : int = X
Copy full snippet(1 line long)
Technically, void can be thought of as a function defined as
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.