aboutsummaryrefslogtreecommitdiff
path: root/source/program.lux
blob: 20f7863ab49513de26fc6a96af5a57562528388a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(;alias-lux)

(def (filter p xs)
  (All [a] (-> (-> a Bool) (List a) (List a)))
  (case xs
    #;Nil
    (list)

    (#;Cons [x xs'])
    (if (p x)
      (list& x (filter p xs'))
      (filter p xs'))))

(_jvm_program _
              (exec (println "Hello, world!")
                (|> (int:+ 2 2) ->text ($ text:++ "2 + 2 = ") println)
                (println (->text (using Int:Ord
                                   (< 5 10))))))