aboutsummaryrefslogtreecommitdiff
path: root/src/lux/compiler/io.clj
blob: e72f34a7b35ff2e79ba46ec08abbec0b3ef8cee5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
;;  Copyright (c) Eduardo Julian. All rights reserved.
;;  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
;;  If a copy of the MPL was not distributed with this file,
;;  You can obtain one at http://mozilla.org/MPL/2.0/.

(ns lux.compiler.io
  (:require (lux [base :as & :refer [|let |do return* return fail fail*]])
            ))

;; [Resources]
(defn read-file [^String path]
  (let [file (new java.io.File path)]
    (if (.exists file)
      (return (slurp file))
      (fail (str "[I/O] File doesn't exist: " path)))))