aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/format/css/class.lux
blob: 1ddfdfebd97a946d09e2c80eccf03437e603ca17 (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
(.require
 [library
  [lux (.except)
   ["[0]" meta]
   [abstract
    [monad (.only do)]]
   [data
    ["[0]" text (.use "[1]#[0]" hash)
     ["%" \\format (.only format)]]]
   [macro
    [syntax (.only syntax)]]
   [meta
    ["[0]" code]
    [type
     [primitive (.except)]]]]])

(primitive .public Class
  Text

  (def .public class
    (-> Class Text)
    (|>> representation))

  (def .public custom
    (-> Text Class)
    (|>> abstraction))

  (def .public generic
    (syntax (_ [])
      (do meta.monad
        [module meta.current_module_name
         class meta.seed]
        (in (list (` (..custom (, (code.text (format "c" (%.nat_16 class)
                                                     "_" (%.nat_16 (text#hash module))))))))))))
  )