Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Booleans

Boolean values in God are written as the unquoted text true and false. As in almost any context related to computer science, booleans are a data type used to describe something that has one of two possible values; most commonly true/false and 1/0.

yes = true;
no = false;

Some languages may have unconventional boolean data types, and therefore the implementer may want to use the closest analogue in their language, for example, in Emacs Lisp:

(setq foo t)
(setq bar nil)

There is not false boolean type in the language. There is t to represent a truthy value, and the nil keyword is often used in place of a falsy value.

Warning

Due to the permissiveness of identifiers in God (as well as in Nix), it is completely valid to use true, false and even null as identifiers.

true = false;
false = null;

Using identifiers that use the same name as built-in language types is highly discouraged for obvious reasons, however they are documented here for the purposes of completeness.