 
 (define-context-input-format :colibri
   [file]
-  (loop [in (reader file)
-         objs #{}
-         inz #{}]
-    (let [line (.readLine in)]
-      (cond
-        (not line)
-        (make-context-nc objs (set-of m [[g m] inz]) inz),
-        (or (re-matches #"^\s*$" line)     ; blank
-            (re-matches #"^\s*#.*$" line)) ; comment
-        (recur in objs inz),
-        :else
-        (let [[_ g atts] (re-matches #"^\s*(.+)\s*:\s*(.+)?\s*;\s*(?:#.*)?$" line)
-              atts (and atts (split atts #"\s+"))]
-          (recur in (conj objs g) (union inz (set-of [g m] [m atts]))))))))
+  (with-in-reader file
+    (loop [objs #{},
+           inz  #{}]
+      (let [line (read-line)]
+        (cond
+         (not line)
+         (make-context-nc objs (set-of m [[g m] inz]) inz),
+         (or (re-matches #"^\s*$" line)     ; blank
+             (re-matches #"^\s*#.*$" line)) ; comment
+         (recur objs inz),
+         :else
+         (let [[_ g atts] (re-matches #"^\s*(.+)\s*:\s*(.+)?\s*;\s*(?:#.*)?$" line)
+               atts (and atts (split atts #"\s+"))]
+           (recur (conj objs g) (union inz (set-of [g m] [m atts])))))))))
 
 
 ;; Comma Seperated Values (.csv)

(add-context-input-format :csv
                          (fn [rdr]
                            (try
                             (re-matches #"^[^,]+,[^,]+$" (.readLine rdr))
                             (catch Exception _))))

(define-context-input-format :csv
  [file]
  (let [in (reader file)]
    (loop [inz #{}]
      (let [line (.readLine in)]
        (if (not line)
          (make-context-nc (set-of g [[g m] inz])
                           (set-of m [[g m] inz])


(add-context-input-format :simple
                          (fn [rdr]
                            (= "conexp-clj simple" (read-line))))

(define-context-output-format :simple
  [ctx file]
