Marcel van Lohuizen | af0932f | 2019-01-11 13:03:56 +0100 | [diff] [blame] | 1 | [TOC](Readme.md) [Prev](defaults.md) [Next](numbers.md) |
| 2 | |
Marcel van Lohuizen | 3e592b4 | 2019-01-11 20:31:29 +0100 | [diff] [blame] | 3 | _Types ~~and~~ are Values_ |
Marcel van Lohuizen | 75cb003 | 2019-01-11 12:10:48 +0100 | [diff] [blame] | 4 | |
| 5 | # Disjunctions of Structs |
| 6 | |
| 7 | Disjunction work for any type. |
| 8 | |
| 9 | In this example we see that a `floor` of some specific house |
| 10 | has 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. |
| 15 | floor: { |
| 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. |
| 21 | floor: { |
| 22 | level: 0 | 1 |
| 23 | hasExit: true |
| 24 | } | { |
| 25 | level: -1 | 2 | 3 |
| 26 | hasExit: false |
| 27 | } |
| 28 | ``` |