oxedyne/fe2o3/fe2o3_austenite/tests/fixtures/eval/foundation/foundations.txt
3.3 KiB, 1 run
created by r1870400018:63834, which is this file's identity for as long as the history lasts, whatever it is later renamed to
download · who wrote it · its history
| 1 | // Type constructors, conversions, int/float/version/bytes methods, range, type scopes. |
| 2 | type(1) |
| 3 | type(1.5) |
| 4 | type("a") |
| 5 | type(none) |
| 6 | type(auto) |
| 7 | type(type) |
| 8 | type(int) |
| 9 | type(calc) |
| 10 | type(calc.pow) |
| 11 | type(1pt) |
| 12 | type(50%) |
| 13 | type(50% + 1pt) |
| 14 | type(red) |
| 15 | type(left) |
| 16 | type(ltr) |
| 17 | type(sym.alpha) |
| 18 | type(bytes("a")) |
| 19 | type(<l>) |
| 20 | type(version(1)) |
| 21 | type((1,)) |
| 22 | type((a: 1)) |
| 23 | type(datetime(year: 2020, month: 1, day: 1)) |
| 24 | type(duration(days: 1)) |
| 25 | str(1.0) |
| 26 | str(1e20) |
| 27 | str(-1.5) |
| 28 | str(-5) |
| 29 | str(10, base: 16) |
| 30 | str(-10, base: 2) |
| 31 | str(255, base: 36) |
| 32 | str(1.23456789e-7) |
| 33 | str(float.nan) |
| 34 | str(-float.inf) |
| 35 | str(float.inf) |
| 36 | str(<lab>) |
| 37 | str(version(1, 2)) |
| 38 | str(bytes("é")) |
| 39 | str(sym.alpha) |
| 40 | str(int) |
| 41 | !str(1, base: 37) |
| 42 | !str(bytes((255,))) |
| 43 | !str(true) |
| 44 | !str(none) |
| 45 | !str(1pt) |
| 46 | int("12") |
| 47 | int("-12") |
| 48 | int("+5") |
| 49 | int("−12") |
| 50 | int(1.9) |
| 51 | int(-1.9) |
| 52 | int(true) |
| 53 | int(false) |
| 54 | !int(" 12") |
| 55 | !int("0x10") |
| 56 | !int("1e3") |
| 57 | !int(1e30) |
| 58 | float("1.5") |
| 59 | float("1e3") |
| 60 | float("-inf") |
| 61 | float("inf") |
| 62 | float("nan") |
| 63 | float("1.") |
| 64 | float(".5") |
| 65 | float("−1.5") |
| 66 | float(50%) |
| 67 | float(true) |
| 68 | float(3) |
| 69 | !float(" 1") |
| 70 | !float("1_000") |
| 71 | label("a b") |
| 72 | label("a") |
| 73 | !label("") |
| 74 | version(1, (2, 3)) |
| 75 | version() |
| 76 | version(1, 2).at(5) |
| 77 | version(1, 2).at(-1) |
| 78 | version(1, 2, 3).major |
| 79 | version(1, 2, 3).minor |
| 80 | version(1, 2, 3).patch |
| 81 | !~version(1).minor |
| 82 | bytes("ab").len() |
| 83 | bytes("abc").at(1) |
| 84 | bytes("abc").at(-1) |
| 85 | bytes("abc").at(5, default: 0) |
| 86 | array(bytes("abcdef").slice(1, 3)) |
| 87 | array(bytes("abcdef").slice(1, count: 2)) |
| 88 | array(bytes("abcdef").slice(-2)) |
| 89 | array(bytes((1, 2, 3))) |
| 90 | !bytes("abc").at(5) |
| 91 | !bytes(0x41) |
| 92 | !bytes((1, 256)) |
| 93 | array(bytes("ab")) |
| 94 | array(version(1, 2)) |
| 95 | array((1, 2)) |
| 96 | !array("ab") |
| 97 | range(5) |
| 98 | range(2, 5) |
| 99 | range(0, 10, step: 3) |
| 100 | range(5, 0, step: -2) |
| 101 | range(-3) |
| 102 | array.range(3) |
| 103 | !range(0, 5, step: 0) |
| 104 | (5).signum() |
| 105 | (-5).signum() |
| 106 | (0).signum() |
| 107 | (-0.0).signum() |
| 108 | (0.0).signum() |
| 109 | float.nan.signum() |
| 110 | (12).bit-and(10) |
| 111 | (12).bit-or(10) |
| 112 | (12).bit-xor(10) |
| 113 | (12).bit-not() |
| 114 | (1).bit-lshift(62) |
| 115 | (-8).bit-rshift(1) |
| 116 | (-8).bit-rshift(1, logical: true) |
| 117 | (-8).bit-rshift(70) |
| 118 | !(1).bit-lshift(64) |
| 119 | !(1).bit-lshift(-1) |
| 120 | array((258).to-bytes()) |
| 121 | array((258).to-bytes(endian: "big", size: 4)) |
| 122 | array((-1).to-bytes(size: 2)) |
| 123 | int.from-bytes(bytes((1, 2))) |
| 124 | int.from-bytes(bytes((255, 255)), signed: true) |
| 125 | int.from-bytes(bytes((255, 255)), signed: false, endian: "big") |
| 126 | int.from-bytes(bytes(())) |
| 127 | array((1.5).to-bytes()) |
| 128 | array((1.5).to-bytes(size: 4, endian: "big")) |
| 129 | float.from-bytes(bytes((0, 0, 0, 0, 0, 0, 248, 63))) |
| 130 | float.from-bytes(bytes((0, 0, 192, 63))) |
| 131 | !float.from-bytes(bytes((1, 2, 3))) |
| 132 | (1.0).is-nan() |
| 133 | float.nan.is-nan() |
| 134 | float.inf.is-infinite() |
| 135 | (1.5).is-infinite() |
| 136 | str.len("abc") |
| 137 | str.from-unicode(97) |
| 138 | sys.version |
| 139 | dictionary(sys).len() |
| 140 | repr(repr) |
| 141 | repr(calc.pow) |
| 142 | repr(assert.eq) |
| 143 | assert(true) |
| 144 | assert.eq(1, 1.0) |
| 145 | assert.ne(1, 2) |
| 146 | !assert(false) |
| 147 | !assert(false, message: "custom") |
| 148 | !assert.eq(1, 2) |
| 149 | !assert.ne("a", "a") |
| 150 | !panic() |
| 151 | !panic("oh", 1) |
| 152 | !type(1, 2) |
| 153 | // Routing through the evaluator: type scopes, function scopes and type constructors. |
| 154 | float.inf |
| 155 | float.nan.is-nan() |
| 156 | str.from-unicode(65) |
| 157 | str.to-unicode("A") |
| 158 | color.hsl(10deg, 20%, 30%) |
| 159 | color.mix(red, blue) |
| 160 | color.map.magma.len() |
| 161 | gradient.linear(red, blue).kind() |
| 162 | datetime.today |
| 163 | json.encode((1, 2), pretty: false) |
| 164 | assert.eq |
| 165 | dictionary(sys).keys() |
| 166 | array(bytes("ab")) |
| 167 | array((1, 2)) |
| 168 | direction.from(left) |
| 169 | direction.to(top) |
| 170 | version(1, 2).minor |
| 171 | version(1, 2, 3).patch |
| 172 | !version(1).minor |
| 173 | !version(1).patch |
| 174 | !type(1).foo |
| 175 | bool |
| 176 | !bool(1) |
| 177 | type(polygon.regular) |
| 178 | range(45) |
| 179 | (range(41).map(i => (str(i), i))).to-dict().len() |