A value in Neko can be one of the following :
- Null: the special value
nullis used for uninitialized variables as well as programmer/language specific coding techniques.
- Integer: integers can be represented in either decimal form (such as
-12), or hexadecimal (
- Floats: floating-point numbers are represented using a period (such as
- Boolean: booleans are represented by the following two lowercase identifiers:
- Strings: strings are surrounded by double quotes (for example:
"hello,\nworld !", or
"My name is \"Bond\\James Bond\"."). Neko strings are mutable, which means that you can modify them.
- Arrays: arrays are an integer-indexed table of values, with the index starting at 0. They provide fast random access to their elements.
- Objects: an object is a table, which associates an identifier or a string to a value. How objects are created and managed is explained later.
- Functions: a function is also a value in Neko, and thus can be stored in any variable.
- Abstract: an abstract value is C data that cannot be accessed from a Neko program.
- Integers have 31 bits for virtual machine performance reasons. An API for full 32-bit integers is available through a standard library.
- Floating-point numbers are 64-bit double-precision floating points values.
- Strings are sequences of 8-bit bytes. A string can contain
\0characters. The length of a string is determined by the number of bytes in it, and not by the number of characters before the first \0.