blob: 5cbc9ac9c99734c1f911d82eab8089a5edc3022a [file] [log] [blame] [view]
Marcel van Lohuizenaf0932f2019-01-11 13:03:56 +01001[TOC](Readme.md) [Prev](defaults.md) [Next](numbers.md)
2
Marcel van Lohuizen3e592b42019-01-11 20:31:29 +01003_Types ~~and~~ are Values_
Marcel van Lohuizen75cb0032019-01-11 12:10:48 +01004
5# Disjunctions of Structs
6
7Disjunction work for any type.
8
9In this example we see that a `floor` of some specific house
10has an exit on level 0 and 1, but not on any other floor.
11
12<!-- CUE editor -->
13```
14// floor defines the specs of a floor in some house.
15floor: {
16 level: int // the level on which this floor resides
17 hasExit: bool // is there a door to exit the house?
18}
19
20// constraints on the possible values of floor.
21floor: {
22 level: 0 | 1
23 hasExit: true
24} | {
25 level: -1 | 2 | 3
26 hasExit: false
27}
28```