aboutsummaryrefslogtreecommitdiff
path: root/source/program.lux
blob: cefec07d4c536cbb0e8e3c1f5af0c55749e65168 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(;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))))))