Fork me on GitHub
#beginners
<
2019-06-29
>
Nate Sutton00:06:41

wow, comp is useful

Nate Sutton00:06:07

kind of wish it went left to right though

Nate Sutton00:06:17

but I guess that's what threading's for

PaulGureghian00:06:41

For a key binding like this: ctrl-, f': 'chlorine:load-file' , just hit 'ctrl' then 'b' as usual ?

andy.fingerhut00:06:33

The suggested key bindings for Atom, it is actually a little weirder than that: ctrl-, means to hold down the Control key while typing the comma key. Let both go, then type f.

andy.fingerhut00:06:22

You can of course choose other key bindings if you wish, but might want to experiment with the suggested ones for a little while first and see if they grow on you or not.

PaulGureghian00:06:03

Hey, it worked

🎉 1
PaulGureghian01:06:56

Is there an online Clojure forum ? I didn't see any on http://Clojure.org

andy.fingerhut01:06:30

There are https://clojureverse.org and https://www.reddit.com/r/Clojure that I am aware of. There is a Clojure Google group, but I think a lot of the activity has moved away from there over the last several years to other places.

PaulGureghian01:06:00

Clojureverse looks pretty good at first glance

NoahTheDuke01:06:25

quick question: is there a way to make dissoc on a Record return a version of the record with nil as the value, instead of converting to a map?

andy.fingerhut01:06:40

Nothing built in that I am aware of. You can use assoc with a value of nil to do so.

NoahTheDuke01:06:18

cool, that's what i thought

PaulGureghian02:06:47

Whats up with REBL ? Yea or Nay ? http://rebl.cognitect.com/

andy.fingerhut02:06:38

Sean Corfield has recorded a few screencasts recently to demonstrate one possible work flow that takes advantage of REBL. I know he really finds it productivity-enhancing, so I'm inclined to look further myself some time, hopefully soon.

andy.fingerhut02:06:04

Given my current lack of knowledge about it, I would say you don't need to learn to use it in order to learn Clojure, and there are plenty of things to learn other than that if you are new to the language, so don't feel you have to tackle that right from the start.

PaulGureghian02:06:57

I agree. I don't want to get overwhelmed

seancorfield02:06:19

Agreed. REBL is great once you have already internalized a REPL-driven workflow, and you want better visualization of results than the REPL can provide. Until you're at that point, don't worry about it.

PaulGureghian02:06:50

deps-edn... deps is dependencies. what is edn ?

magra09:06:06

what is the purpose of

#'
on a Symbol in function position? E.g.
(#'idx/index runtime LinkChild)
. I found that in a let here and am trying to grasp the implications: Lines 88, 97 and 107 in https://github.com/fulcrologic/fulcro3/blob/develop/src/test/com/fulcrologic/fulcro/algorithms/indexing_spec.cljc#L88

Crispin10:06:24

its a reader macro that expands #'foo to (var foo) https://clojuredocs.org/clojure.core/var

Crispin10:06:50

this returns the var itself. ie. doesn't evaluate the passed in thing and return its value

Crispin10:06:29

why is it being used in that code? good question...

Crispin10:06:37

might be related to it being a test.

alexmiller12:06:31

Sometimes this is done to invoke private vars

alexmiller12:06:08

The symbol won’t resolve (because it’s private) but the var is always public

alexmiller12:06:02

And invoking a var that refers to a function will invoke the function

Felix Linker12:06:45

Peeps, I desperately need some help resolving a specific issue. I've written some code that generates a map. Like so:

(zipmap keys
        (map f keys))
Then, I not only wanted to map keys with f but also with g like so:
(zipmap keys
        (map (comp g f) keys))
However, exeuting that code in the REPL gives me:
Syntax error (NullPointerException) compiling at (form-init6822426521249811109.clj:1:8).
null
class clojure.lang.Compiler$CompilerException
Show: NoneClojureJavaToolingDuplicates
Compiler.java:	3707	clojure.lang.Compiler$InvokeExpr/eval
Compiler.java:	457	clojure.lang.Compiler$DefExpr/eval
Compiler.java:	7181	clojure.lang.Compiler/eval
Compiler.java:	7131	clojure.lang.Compiler/eval
core.clj:	3214	clojure.core/eval
core.clj:	3210	clojure.core/eval
main.clj:	414	clojure.main/repl/read-eval-print/fn
main.clj:	414	clojure.main/repl/read-eval-print
main.clj:	435	clojure.main/repl/fn
main.clj:	435	clojure.main/repl
main.clj:	345	clojure.main/repl
RestFn.java:	1523	clojure.lang.RestFn/invoke
interruptible_eval.clj:	79	nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj:	55	nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj:	142	nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
AFn.java:	22	clojure.lang.AFn/run
session.clj:	171	nrepl.middleware.session/session-exec/main-loop/fn
session.clj:	170	nrepl.middleware.session/session-exec/main-loop
AFn.java:	22	clojure.lang.AFn/run
nil:	-1	java.lang.Thread/run
What does that mean? I have no clue what to do. If I call g on some value of the map, that works out fine.

Felix Linker12:06:01

Ah! Got my first hint. Apparently, this issue comes from me wrapping said code execution in a (def v (call-to-my-f with-an-arg). If I just do (call-to-my-f with-an-arg) in the REPL, the exception becomes clearer :thinking_face:

alexmiller12:06:40

it's not obvious, but those are two different paths in the compiler

alexmiller12:06:16

(comp g f) == #(g (f %)) - were you expecting #(f (g %)) ?

Felix Linker12:06:19

No, that was alright. I just didn't know how to interpret that specific exception. And now I'm wondering why (def v (f x)) gives me a different exception than (f x) in the REPL.

alexmiller12:06:03

the former does an eval path while the latter will compile and then invoke. the exception handling is a little different. I'd be curious what the differences were. (there was actually a fix in this area in 1.10.1 so in particular wondering if you're on that)

magra19:06:42

@alexmiller Thanks! I will have to meditate on that 😉

PaulGureghian22:06:41

My Clojure repo. looking for tips / advice / critiques ... on my structure, what to keep , what to ignore ... https://github.com/paulgureghian/Clojure

Felix Linker23:06:28

You certainly should add *.DS_Store to your .gitignore to begin with.

andy.fingerhut23:06:03

The (:gen-class) expressions within the ns forms are only needed in fairly specific circumstances that you may not have encountered yet. I do not know if there are any circumstances where they can add confusing behavior, but certainly seems simpler to leave those out if you are not in a situation where it is necessary.

andy.fingerhut23:06:14

Your core.clj file contains a call to a function (hello-clojurians) that will cause that function to be called every time that file is loaded. Occasionally you do want such side effects just from loading a file, but again, maybe best to comment out that call in most situations.

💯 1