<18bf07b6b2f.110f766b81830871.6063466823224780232@1w1g.com>
Following https://github.com/Robert-van-Engelen/tinylisp (https://github.com/Robert-van-Engelen/tinylisp/blob/main/tinylisp.pdf) How could I do NaN boxing in hare example C code: ``` #define I unsigned #define L double /*** with NaN Boxing ***/ L box(I t,I i) { L x; *(uint64_t*)&x = (uint64_t)t<<48|i; return x; } I ord(L x) { return *(uint64_t*)&x; } ```
<CX4C9WSMTDBT.36I6UAOJZLSZZ@taiga>
<18bf07b6b2f.110f766b81830871.6063466823224780232@1w1g.com>
(view parent)
I'm not sure what NaN boxing is, but the same code rewritten to use Hare-style casts et al should work the same way I think.