Fork me on GitHub
#beginners
<
2018-12-15
>
jayzawrotny00:12:26

{:aliases {:repl {:extra-deps {nrepl {:mvn/version "0.5.3"}
                               proto-repl {:mvn/version "0.3.1"}
                               cider/cider-nrepl {:mvn/version "0.18.0"}}}
           :rebl {:extra-deps {com.cognitect.rebl {:local/root "./resources/REBL-0.9.109.jar"}
                               rickmoynihan/rebl.middleware {:local/root "../nrebl.middleware"}
                               org.clojure/clojure {:mvn/version "1.10.0-RC5"}
                               org.clojure/core.async {:mvn/version "0.4.490"}}
                  :main-opts ["-m" "nrepl.cmdline"
                              "--interactive"
                              "--middleware" "[cider.nrepl/cider-middleware,nrebl.middleware/wrap-nrebl]"]}}}

jayzawrotny00:12:26

{:aliases {:repl {:extra-deps {nrepl {:mvn/version "0.5.3"}
                               proto-repl {:mvn/version "0.3.1"}
                               cider/cider-nrepl {:mvn/version "0.18.0"}}}
           :rebl {:extra-deps {com.cognitect.rebl {:local/root "./resources/REBL-0.9.109.jar"}
                               rickmoynihan/rebl.middleware {:local/root "../nrebl.middleware"}
                               org.clojure/clojure {:mvn/version "1.10.0-RC5"}
                               org.clojure/core.async {:mvn/version "0.4.490"}}
                  :main-opts ["-m" "nrepl.cmdline"
                              "--interactive"
                              "--middleware" "[cider.nrepl/cider-middleware,nrebl.middleware/wrap-nrebl]"]}}}

jayzawrotny00:12:08

Exception in thread "main" java.lang.RuntimeException: EOF while reading
        at clojure.lang.Util.runtimeException(Util.java:221)
        at clojure.lang.EdnReader.readDelimitedList(EdnReader.java:746)
        at clojure.lang.EdnReader$VectorReader.invoke(EdnReader.java:672)
        at clojure.lang.EdnReader.read(EdnReader.java:145)
        at clojure.lang.EdnReader.read(EdnReader.java:111)
        at clojure.lang.EdnReader.readString(EdnReader.java:67)
        at clojure.edn$read_string.invokeStatic(edn.clj:46)
        at clojure.edn$read_string.invokeStatic(edn.clj:37)
        at clojure.edn$read_string.invoke(edn.clj:37)
        at nrepl.cmdline$parse_cli_values$fn__1241.invoke(cmdline.clj:235)
        at clojure.core$fn__8414$fn__8416.invoke(core.clj:6840)
        at clojure.core.protocols$iter_reduce.invokeStatic(protocols.clj:49)
        at clojure.core.protocols$fn__8125.invokeStatic(protocols.clj:75)
        at clojure.core.protocols$fn__8125.invoke(protocols.clj:75)
        at clojure.core.protocols$fn__8073$G__8068__8086.invoke(protocols.clj:13)
        at clojure.core$reduce.invokeStatic(core.clj:6828)
        at clojure.core$fn__8414.invokeStatic(core.clj:6830)
        at clojure.core$fn__8414.invoke(core.clj:6830)
        at clojure.core.protocols$fn__8152$G__8147__8161.invoke(protocols.clj:175)
        at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
        at clojure.core$reduce_kv.invoke(core.clj:6847)
        at nrepl.cmdline$parse_cli_values.invokeStatic(cmdline.clj:233)
        at nrepl.cmdline$parse_cli_values.invoke(cmdline.clj:229)
        at nrepl.cmdline$run.invokeStatic(cmdline.clj:245)
        at nrepl.cmdline$run.invoke(cmdline.clj:240)
        at nrepl.cmdline$_main.invokeStatic(cmdline.clj:296)
        at nrepl.cmdline$_main.doInvoke(cmdline.clj:293)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.lang.Var.applyTo(Var.java:705)
        at clojure.core$apply.invokeStatic(core.clj:665)
        at clojure.main$main_opt.invokeStatic(main.clj:491)
        at clojure.main$main_opt.invoke(main.clj:487)
        at clojure.main$main.invokeStatic(main.clj:598)
        at clojure.main$main.doInvoke(main.clj:561)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.lang.Var.applyTo(Var.java:705)
        at clojure.main.main(main.java:37)
Is the full exception

jayzawrotny00:12:56

If I run that with clj -A:repl:rebl I get EOF while reading. Based on trial and error it seems to have to do with the middleware line

jayzawrotny00:12:25

Further tests point to wanting two things in middleware

jayzawrotny00:12:36

But it works with either one

jayzawrotny00:12:21

Oh, had to comma separate them

seancorfield01:12:53

The "Corfield Comma" to the rescue... 🙂

ali.ebadian11:12:12

Hi again, here with another basic question. Why is this wrong? (let [mapa {a: "s"} mapb {:b "f"}] (println("Hello")))

ali.ebadian11:12:37

can we not use maps in let statements?

rakyi11:12:39

maybe a typo? you have colon as the last char in the key in {a: "s"} you probably want {:a "s"}

ali.ebadian11:12:40

damn it, I knew it was too early on Saturday to learn Clojure

alexpashkov12312:12:37

And also you should have just (println "Hello")

alexpashkov12312:12:16

Now you do it like it's not a lisp

jaihindh.reddy14:12:48

I know this works but should anyone ever do it?

(->> [a b]
  (for [a [:a :b :c]
        b (range 3)]))

jaihindh.reddy14:12:42

Writing symbols that are in a different scope before macroexpansion.

alexmiller14:12:00

that seems very confusing for later readers

dnd.pliz15:12:01

Hey, guys, how can I get rid of these lines after REPL starts?

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by mranderson048.orchard.v0v3v0.dynapath.v0v2v5.dynapath.defaults$eval2132$fn__2133 to method java.net.URLClassLoader.addURL(java.net.URL)

dnd.pliz15:12:57

@mfikes thanks, I'll look

toxnico16:12:42

Hello there, I'm currently learning clojure I'm doing exercises on http://exercism.io, and have a question about partial application of functions: If I have a function that accepts arguments [a b], how can I partially apply argument b, so I get a function expecting only argument a ?

lilactown16:12:11

you can use an anonymous function

lilactown16:12:27

(defn add [a b] (+ a b))

(fn [a] (add a 2))
;; => returns a function of only `a`

#(add % 2)
;; => same as above, short-hand syntax

toxnico16:12:12

oh ok, so no placeholders available in the language

toxnico16:12:35

that's ok, thanks a lot !

lilactown16:12:16

sure thing. I think most people would use #() if they needed a quick partial application

toxnico16:12:25

great, thanks! I go this way 🙂

dpsutton17:12:45

@toxnico check out the core function "partial"

toxnico17:12:02

@dpsutton thanks, that's what I did, but partial does not allow to apply second argument only, and leave the first unapplied.

dpsutton18:12:10

Yeah I read that right after I mentioned partial :) sorry about the noise

christian23919:12:17

1. The Little Schemer book 2. Clojure Koans exercises 3. Getting Clojure book 4. What’s the best next step to learn? Anything that’s more focussed on design/architecture than the previous three?

ericcervin19:12:01

Web Development with Clojure: Build Bulletproof Web Apps with Less Code

ericcervin19:12:25

I feel like I'm really making progress when I've got to "Hello http request" in any language

anantpaatra23:12:49

Since SICP was mentioned and you specifically stated "design/architecture", you should definitely take a look at How to Design Programs. It's Scheme (but you came from Little Schemer), and many believe it to be more approachable and digestible than SICP.

lvbarbosa19:12:46

@christian239 One of my best readings on that topic was Structure and Interpretation of Computer Programs

seancorfield21:12:41

@christian239 Take a look at Clojure Applied -- although it may be a big step up from Getting Clojure (hard for me to tell at this point -- been years since I started with Clojure and a lot of these books weren't around then).