-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the Nala wiki!
This wiki is meant to be an exhaustive reference for Nala's features. For a quick look at how nala works, see the examples
directory in the project repo.
Everything is an expression in Nala, including "statements" like assignment operations. Some expressions resolve to values of type Void though, which cannot be assigned.
Each line in Nala resolves to a value. A function returns the first resolved line it reaches in execution which is not Void
. Otherwise, a function always returns the resolved value of the last line it reaches in execution, which can be of type Void
.
This may seem like a strange concept, but in practice results in function definitions which are very similar to those in other languages, but with no need for a return
keyword.
A non-Void
value is considered "captured" when it is converted to a Void
value. This happens most commonly as a result of an assignment operation, or the value being passed as an argument to a function which returns Void
.
In most cases we do not have to worry about explicitly capturing our values. Sometimes however we will want to capture and swallow a non-Void
value so that we do not return before we're ready. For those uncommon situations, the builtin void function has been supplied as a convenience.
Note: This is subject to change
For cases where we want to end function execution and return early, the break
keyword is provided.
Nala Documentation
- Navigation
- Basics
- Primitive Types
- Constructing Types
- Builtins