Skip to content

Commit 133b19c

Browse files
authored
Remove duplicate definition of spit and slurp (#975)
Seems like a goof from #961 where I had a duplicate definition of `spit` and `slurp`.
1 parent 538be4c commit 133b19c

File tree

1 file changed

+1
-48
lines changed

1 file changed

+1
-48
lines changed

src/basilisp/core.lpy

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6968,7 +6968,7 @@
69686968

69696969
Returns ``nil`` in all cases."
69706970
[proc coll]
6971-
(reduce #(proc %2) nil coll)
6971+
(reduce (fn [_ v] (proc v)) nil coll)
69726972
nil)
69736973

69746974
;;;;;;;;;;;;;;;;;;
@@ -7315,53 +7315,6 @@
73157315
m))
73167316
(meta m)))
73177317

7318-
;;;;;;;;;;;;;;;;;;
7319-
;; IO Utilities ;;
7320-
;;;;;;;;;;;;;;;;;;
7321-
7322-
;; This is a circular import since namespaces using 'ns will always try to refer all
7323-
;; symbols from 'basilisp.core. This should be fine since we won't be using anything
7324-
;; from core defined below this section, but still this is a bad pattern and should
7325-
;; not be replicated.
7326-
(require 'basilisp.io)
7327-
7328-
(defn slurp
7329-
"Open a :lpy:fn:`basilisp.io/reader` instance on ``f`` and read the contents of ``f``
7330-
into a string.
7331-
7332-
Options may be provided as key value pairs and will be passed directly to
7333-
``basilisp.io/reader``\\. Supported reader options depend on which type of reader is
7334-
selected for ``f``\\. Most readers support the ``:encoding`` option.
7335-
7336-
If ``f`` is a string, it first is resolved as a URL (via ``urllib.parse.urlparse``\\).
7337-
If the URL is invalid or refers to a filesystem location (via ``file://`` scheme),
7338-
then it will be resolved as a local filesystem path.
7339-
7340-
Return the string contents."
7341-
[f & opts]
7342-
(with-open [reader (apply basilisp.io/reader f opts)]
7343-
(.read reader)))
7344-
7345-
(defn spit
7346-
"Open a :lpy:fn:`basilisp.io/writer` instance on ``f`` and write ``content`` out to
7347-
``f`` before closing the writer.
7348-
7349-
Options may be provided as key value pairs and will be passed directly to
7350-
``basilisp.io/writer``\\. Supported writer options depend on which type of writer is
7351-
selected for ``f``\\. Most writers support the ``:encoding`` option.
7352-
7353-
If ``f`` is a string, it first is resolved as a URL (via ``urllib.parse.urlparse``\\).
7354-
If the URL is invalid or refers to a filesystem location (via ``file://`` scheme),
7355-
then it will be resolved as a local filesystem path.
7356-
7357-
``spit`` does not support writing to non-file URLs.
7358-
7359-
Return ``nil``\\."
7360-
[f content & opts]
7361-
(with-open [writer (apply basilisp.io/writer f opts)]
7362-
(.write writer content)
7363-
nil))
7364-
73657318
;;;;;;;;;;
73667319
;; Taps ;;
73677320
;;;;;;;;;;

0 commit comments

Comments
 (0)