blob: 6b1e32a36547b72b381b3e05ff495bb9b966345a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
(.module:
[lux (#- i64)
[control
[pipe (#+ cond> new>)]]
[data
[number
["." frac]]]
[target
["_" js (#+ Computation)]]]
["." // #_
["#." runtime]])
(def: #export bit
(-> Bit Computation)
_.boolean)
(def: #export (i64 value)
(-> (I64 Any) Computation)
(//runtime.i64//new (|> value //runtime.high .int _.i32)
(|> value //runtime.low .int _.i32)))
(def: #export f64
(-> Frac Computation)
(|>> (cond> [(f/= frac.positive-infinity)]
[(new> _.positive-infinity [])]
[(f/= frac.negative-infinity)]
[(new> _.negative-infinity [])]
[(f/= frac.not-a-number)]
[(new> _.not-a-number [])]
## else
[_.number])))
(def: #export text
(-> Text Computation)
_.string)
|