Fork me on GitHub
#beginners
<
2017-08-21
>
timo18:08:53

can someone maybe help me, where I am wrong?

noisesmith18:08:30

@timok vectorize is missing a paren around map and what should be its args

noisesmith18:08:21

instead it's throwing away map, throwing away an anonymous function, then returning its arg (stats)

timo18:08:02

oh man.. thanks

noisesmith18:08:08

@timok and as a small style concern, if you want to be able to see updatedstats, maybe clojars-stats should be a function instead of a def, so it can gather the latest stats on each call?

noisesmith18:08:26

(and to reuse it one could just capture its return value in a def)

timo18:08:28

sure...step by step:)

noisesmith18:08:50

otherwise it looks great, especially for beginner code

casualuser18:08:55

greetings one! newbie for clojure and react but have experience with other web techs faced existing #om app to tweak. so have a simple question - how to create side menu ? simple side menu with fixed width

casualuser18:08:16

there is exists top navbar menu and I need to get extra left side navbar is there simple answer or should I invent it with divs/classes?

noisesmith18:08:44

you might want to follow that link that auto-generated when you mentioned the #om channel

casualuser18:08:46

@noisesmith seems everybody watching eclipse in case nobody answer there for a hour already...

timo18:08:33

can somebody give me a hint on how to reload the repl when I added a function to the code? still exiting and starting the repl everytime.

noisesmith19:08:45

@timok many editors have shortcuts for this, but the other options in a naked repl are (require 'my.ns :reload) or (load-file "relative/path/to/my_ns.clj") (usually you only need the second version if the ns is defined in a lib somewhere else on disk)

noisesmith19:08:04

there are some things that tend to behave oddly when reloaded (`defmulti` and defprotocol in particular, and anything that captures a value in a running context...) and there are tools like clojure.tools.namespace/refresh that help with those things

noisesmith19:08:14

but usually a simple load-file or :reload arg to require does the trick

noisesmith19:08:41

the previously mentioned editor shortcuts are calling load-file since it's more general and works on anything the editor has open (even if it has to put something in a tmp file first)

timo19:08:12

thanks, that will help me a lot

noisesmith19:08:42

I'll even put some code in a temporary file and use load-file on it for some things that are in that gray area where they don't actually belong in any namespace (or even in my code base really) but they are awkward to type directly into the repl over and over

casualuser19:08:05

can someone at least point me with any examples of simple left side navbar-nav solution for react/clojure ?

alice19:08:56

So I've like never used a namespaced keyword in my life, how high-value are those?

noisesmith19:08:56

They are good for when you want to attach data to something that only a specific namespace would care about, or make it clear that that namespace is the context it comes from. They are utilized extensively in clojure.spec, since one namespace's idea of what ::read means might be about the verb ("should read this") and the others might be about the adjective ("this was read in") - as a random example of name conflicts