|
6968 | 6968 |
|
6969 | 6969 | Returns ``nil`` in all cases."
|
6970 | 6970 | [proc coll]
|
6971 |
| - (reduce #(proc %2) nil coll) |
| 6971 | + (reduce (fn [_ v] (proc v)) nil coll) |
6972 | 6972 | nil)
|
6973 | 6973 |
|
6974 | 6974 | ;;;;;;;;;;;;;;;;;;
|
|
7315 | 7315 | m))
|
7316 | 7316 | (meta m)))
|
7317 | 7317 |
|
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 |
| - |
7365 | 7318 | ;;;;;;;;;;
|
7366 | 7319 | ;; Taps ;;
|
7367 | 7320 | ;;;;;;;;;;
|
|
0 commit comments