aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/meta/compiler/target/jvm/magic.lux
blob: 251850f066e04f68affd1084a7a17cdbb4ae38c0 (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
... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

(.require
 [library
  [lux (.except)
   [control
    ["[0]" try]]
   [math
    [number (.only hex)]]]]
 ["[0]" //
  [encoding
   ["[1][0]" unsigned (.only U4)]]])

(type .public Magic
  U4)

(def .public code
  Magic
  (|> (hex "CAFEBABE")
      //unsigned.u4
      try.trusted))

(def .public format
  //unsigned.format/4)