blob: 8e1bf0296bc525d2127abc4fc98f60622ec69ece [file] [log] [blame] [view]
Marcel van Lohuizen75cb0032019-01-11 12:10:48 +01001[TOC](Readme.md) [Prev](duplicates.md) [Next](types.md)
2
Marcel van Lohuizen3e592b42019-01-11 20:31:29 +01003_Types ~~and~~ are Values_
Marcel van Lohuizenaf0932f2019-01-11 13:03:56 +01004
Marcel van Lohuizen75cb0032019-01-11 12:10:48 +01005# Bottom
6
Marcel van Lohuizen3e592b42019-01-11 20:31:29 +01007Specifying duplicate fields with conflicting values results in an error
8or bottom.
9_Bottom_ is a special value in CUE, denoted `_|_`, that indicates an
10error such as incompatible values.
11Any error in CUE results in `_|_`.
12Logically all errors are equal, although errors may be associated with
13metadata such as an error message.
Marcel van Lohuizen75cb0032019-01-11 12:10:48 +010014
Jonathan Amsterdame4790382019-01-20 10:29:29 -050015Note that an error is different from `null`: `null` is a valid value,
Marcel van Lohuizen75cb0032019-01-11 12:10:48 +010016whereas `_|_` is not.
17
18<!-- CUE editor -->
19```
20a: 4
21a: 5
22
23l: [ 1, 2 ]
24l: [ 1, 3 ]
Marcel van Lohuizen3e592b42019-01-11 20:31:29 +010025
26list: [0, 1, 2]
27val: list[3]
Marcel van Lohuizen75cb0032019-01-11 12:10:48 +010028```
29
30<!-- result -->
31```
Marcel van Lohuizen3e592b42019-01-11 20:31:29 +010032a: _|_
33l: _|_
34list: [0, 1, 2]
35val: _|_
Jonathan Amsterdame4790382019-01-20 10:29:29 -050036```