From 629ad2e0971efcf58934c76ea1306b0ff0629339 Mon Sep 17 00:00:00 2001 From: Brujo Benavides Date: Wed, 8 Aug 2018 12:51:59 -0300 Subject: Add clarification on nil type As explained by @psyeugenic on Slack: > empty list `[]` is regarded as a separate type from `list()`, `[]` < `list()` > i.e. nil is `[]` --- system/doc/reference_manual/expressions.xml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'system/doc') diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml index 94e40dd077..684a1191d0 100644 --- a/system/doc/reference_manual/expressions.xml +++ b/system/doc/reference_manual/expressions.xml @@ -567,6 +567,10 @@ Expr1 op Expr2 order is defined:

 number < atom < reference < fun < port < pid < tuple < map < nil < list < bit string
+

nil in the previous expression represents the empty list + (i.e. []), which is regarded as a separate type from + list/0. That's why nil < list. +

Lists are compared element by element. Tuples are ordered by size, two tuples with the same size are compared element by element.

-- cgit v1.2.3