aboutsummaryrefslogtreecommitdiff
path: root/source/test2.lux
blob: c72602edbf177e55867ca9c45fca3cf94d740478 (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
(use "./util" as util)

(def (print-enum enum)
  (case enum
    #Nil
    (println "")
    
    (#Cons [idx x] enum')
    (do (print "[") (print idx) (print ":") (print x) (print "]") (print " ")
        (print-enum enum'))))

#((def monadic-dup
  (util/exec [foo get-state
              bar get-state
              baz (util/return 1000)]
    (util/return (+ (+ foo bar) baz)))))#

(def (print-map list-map)
  (do (print "{")
    (print (fold concat "" (interpose " " (map show-kv list-map))))
    (println "}")))

## Program
(def (main args)
  (println "Hello, world!"))