Oregami
Repositories/oxedyne/fe2o3

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.
2type(1)
3type(1.5)
4type("a")
5type(none)
6type(auto)
7type(type)
8type(int)
9type(calc)
10type(calc.pow)
11type(1pt)
12type(50%)
13type(50% + 1pt)
14type(red)
15type(left)
16type(ltr)
17type(sym.alpha)
18type(bytes("a"))
19type(<l>)
20type(version(1))
21type((1,))
22type((a: 1))
23type(datetime(year: 2020, month: 1, day: 1))
24type(duration(days: 1))
25str(1.0)
26str(1e20)
27str(-1.5)
28str(-5)
29str(10, base: 16)
30str(-10, base: 2)
31str(255, base: 36)
32str(1.23456789e-7)
33str(float.nan)
34str(-float.inf)
35str(float.inf)
36str(<lab>)
37str(version(1, 2))
38str(bytes("é"))
39str(sym.alpha)
40str(int)
41!str(1, base: 37)
42!str(bytes((255,)))
43!str(true)
44!str(none)
45!str(1pt)
46int("12")
47int("-12")
48int("+5")
49int("−12")
50int(1.9)
51int(-1.9)
52int(true)
53int(false)
54!int(" 12")
55!int("0x10")
56!int("1e3")
57!int(1e30)
58float("1.5")
59float("1e3")
60float("-inf")
61float("inf")
62float("nan")
63float("1.")
64float(".5")
65float("−1.5")
66float(50%)
67float(true)
68float(3)
69!float(" 1")
70!float("1_000")
71label("a b")
72label("a")
73!label("")
74version(1, (2, 3))
75version()
76version(1, 2).at(5)
77version(1, 2).at(-1)
78version(1, 2, 3).major
79version(1, 2, 3).minor
80version(1, 2, 3).patch
81!~version(1).minor
82bytes("ab").len()
83bytes("abc").at(1)
84bytes("abc").at(-1)
85bytes("abc").at(5, default: 0)
86array(bytes("abcdef").slice(1, 3))
87array(bytes("abcdef").slice(1, count: 2))
88array(bytes("abcdef").slice(-2))
89array(bytes((1, 2, 3)))
90!bytes("abc").at(5)
91!bytes(0x41)
92!bytes((1, 256))
93array(bytes("ab"))
94array(version(1, 2))
95array((1, 2))
96!array("ab")
97range(5)
98range(2, 5)
99range(0, 10, step: 3)
100range(5, 0, step: -2)
101range(-3)
102array.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()
109float.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)
120array((258).to-bytes())
121array((258).to-bytes(endian: "big", size: 4))
122array((-1).to-bytes(size: 2))
123int.from-bytes(bytes((1, 2)))
124int.from-bytes(bytes((255, 255)), signed: true)
125int.from-bytes(bytes((255, 255)), signed: false, endian: "big")
126int.from-bytes(bytes(()))
127array((1.5).to-bytes())
128array((1.5).to-bytes(size: 4, endian: "big"))
129float.from-bytes(bytes((0, 0, 0, 0, 0, 0, 248, 63)))
130float.from-bytes(bytes((0, 0, 192, 63)))
131!float.from-bytes(bytes((1, 2, 3)))
132(1.0).is-nan()
133float.nan.is-nan()
134float.inf.is-infinite()
135(1.5).is-infinite()
136str.len("abc")
137str.from-unicode(97)
138sys.version
139dictionary(sys).len()
140repr(repr)
141repr(calc.pow)
142repr(assert.eq)
143assert(true)
144assert.eq(1, 1.0)
145assert.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.
154float.inf
155float.nan.is-nan()
156str.from-unicode(65)
157str.to-unicode("A")
158color.hsl(10deg, 20%, 30%)
159color.mix(red, blue)
160color.map.magma.len()
161gradient.linear(red, blue).kind()
162datetime.today
163json.encode((1, 2), pretty: false)
164assert.eq
165dictionary(sys).keys()
166array(bytes("ab"))
167array((1, 2))
168direction.from(left)
169direction.to(top)
170version(1, 2).minor
171version(1, 2, 3).patch
172!version(1).minor
173!version(1).patch
174!type(1).foo
175bool
176!bool(1)
177type(polygon.regular)
178range(45)
179(range(41).map(i => (str(i), i))).to-dict().len()