Last active
December 23, 2015 20:29
-
-
Save robkuz/6689840 to your computer and use it in GitHub Desktop.
Run on Linux.
I completely do not understand why this gives me an error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clojure.java.shell :as shell]) | |
(require '[clojure.contrib.string :as string]) | |
(def foo (-> (shell/sh "df" "-P") | |
(:out) | |
(string/split-lines) | |
(map (fn [z] z)))) | |
foo | |
; IllegalArgumentException Don't know how to create ISeq from: user$fn__2690 clojure.lang.RT.seqFrom (RT.java:505) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's because of the last
map
call, it expects the function to be first and the sequence to be second.You use
->
macro, which inserts the result ofsplit-lines
as second parameter of themap
form:Try '->>' instead, it inserts the result as last parameter of next form.