flan/test/programs/shadow-prelude-global.flan

15 lines
514 B
Plaintext

;;;; A program's global named as a prelude function takes the name over for
;;;; its own file, as a program's function does, and the prelude's own calls
;;;; keep the prelude's: sort still swaps with the prelude's swap.
(defonce swap i32 3)
(defonce clamp i32 4)
(defconst reverse i32 5)
(defn main [] i32
(println (+ swap clamp reverse)) ; 12
(let [xs [3 1 2]]
(sort (slice xs))
(println (at xs 0)) ; 1
(println (at xs 2))) ; 3
0)