Fork me on GitHub
#beginners
<
2016-04-13
>
mss15:04:44

hey all, very beginner core.async question. can’t for the life of me figure out why the following isn’t logging anything in my repl:

mss15:04:48

(def test-chan (chan))

(go
  (map #(>! test-chan %) [1 2 3 4 5]))

(go-loop []
  (println "got val" (<! test-chan))
  (recur))

mfikes15:04:46

@mss map is lazy. Try run! instead.

mss15:04:22

ah! thanks so much

puhrez15:04:40

literallyt his same thing happened to me

puhrez15:04:57

[5:35 PM] on april 11th

mrwhite15:04:44

Hey! Can you guys suggest any article about how to set up Clojure dev environment based on Emacs. I'm newbie when it comes to Emacs.

puhrez15:04:42

here ya goo

akiva16:04:13

Although learning a new language and a new editor at the same time might be a bit too steep of a learning curve.

bcseda19:04:46

As someone coming from Vim, Spacemacs has certainly been a nice transition into emacs

akiva20:04:40

@bcseda, I’m a huge fan. Nice people behind it.

bcseda20:04:17

I’ve only been using it for a few weeks so far, but I’m really enjoying it

shaun-mahood20:04:39

I've not used it, but there's also http://overtone.github.io/emacs-live/ that looks pretty easy to get started with

seancorfield20:04:38

My team at World Singles uses Emacs Live as our base configuration. Highly recommended. Takes a while to get updates to stuff like CIDER tho’, just FYI.

dancrumb22:04:26

so, i’m just learning about dynamic vars and root altering

dancrumb22:04:37

am i right in thinking that, in general, you want to be avoiding them

dancrumb22:04:45

dynamic vars for shared resources makes sense

dancrumb22:04:58

but otherwise, they feel like glorified global variables

dancrumb22:04:14

and root altering just seems like adding mutability when you really really shouldn’t be

seancorfield22:04:36

Since they are global, you will prevent two parts of your application from using the same library with different settings. For example, at one time java.jdbc had a since global *db* Var for the database connection which meant that you had to be very careful if you were dealing with code that accessed multiple databases (now the db-spec is an argument to the whole API and there’s no global Var).

dancrumb23:04:02

Right... Therein lies my concern

dancrumb23:04:16

Global variables have a very narrow use case

dancrumb23:04:12

I guess their presence in the language shouldn't act as an encouragement to use them

dancrumb23:04:28

So long as you stay within that use case