aboutsummaryrefslogtreecommitdiff
path: root/source/test2.lux
blob: f2fe02bb80a76e1eed2de2007283840a8e076662 (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
(require "./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!"))