This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-14
Channels
- # admin-announcements (2)
- # beginners (8)
- # boot (75)
- # clara (2)
- # cljs-dev (3)
- # cljsjs (39)
- # cljsrn (1)
- # clojure (75)
- # clojure-brasil (3)
- # clojure-dusseldorf (13)
- # clojure-gamedev (1)
- # clojure-mexico (1)
- # clojure-quebec (5)
- # clojure-russia (30)
- # clojure-sg (3)
- # clojure-spec (25)
- # clojure-uk (65)
- # clojurescript (36)
- # core-async (1)
- # cursive (15)
- # data-science (6)
- # datomic (38)
- # devcards (29)
- # editors (1)
- # emacs (11)
- # funcool (6)
- # hoplon (43)
- # immutant (48)
- # lambdaisland (2)
- # leiningen (9)
- # mental-health (4)
- # mount (1)
- # numerical-computing (1)
- # off-topic (4)
- # om (19)
- # onyx (1)
- # pedestal (1)
- # proton (1)
- # re-frame (21)
- # reagent (1)
- # specter (8)
- # sql (3)
- # testing (14)
- # untangled (9)
- # yada (31)
If you are using clj-yaml
please make sure you also include [org.yaml/snakeyaml “1.17”]
it will save you a lot of grief 😛
I have a function (a) in a go block that uses >! and i get the assertion error error that >! is not used in a go block
this problem is mentioned in https://github.com/clojure/core.async/wiki/Go-Block-Best-Practices
@jh398: I don't think there is a general answer besides "simplify your code and keep it in one block"
perhaps what you are trying to do is overly complex already because you feel the need to put it in a separate fn
@jh398 I think you can use a macro here as well?
@macroz yes, the logic in the main go block is complex, that's why i wanted to move parts of it into a separate function
@danielcompton: do you mean rewrite function a as a macro
so the main go block is complex, because it need to wait on various channel at different stages of the game
in the wait-for-start function i need to wait until there is at least 2 but no more than 4 players that have joined the game
I would keep the main loop trivially simple and sequential but use some kind of parallelism in individual steps e.g. AI for each unit or some other embarassingly parallel problem
"waiting for a game start" is definitely not a problem that needs any parallelism besides the UI being responsive while waiting is happening
the game loop should have nothing to do with that part also because that's before the game
so once you start splitting these up maybe you realize that you don't need such a complex construct anyway
i did a version without using core async with atom and that's working well, just wanted to try out using core async to construct a state machine for the game
it's a very simple but popular chinese dice counting game, the aim is to trying to guess or bluff your opponent the values of dice on the table
@peeja: for the class of problem you're describing I have found Specter to be very useful.
(sufficiently so I would nominate it for blessed status as core.navigate, say; YMMV)
I know that transducer's big appeal is that it allows you to specify the nature of a computation without tying it to any particular data structure, stream, collection or whatever, so you only have to write the transducer one time and you can use it everywhere-- but as for its speed compared to the specialized parallel reducer library... I don't know which is faster
@bcbradley: My understanding is "not yet" re: that last question, but I believe parallel transduction in under consideration at some point.
If you have a computationally intensive transformation, parallel fold (in reducers) is probably a better bet. If you have a long pipeline of many transformations, transducers might be better.
I thought CLJ-1553 was supposed to make transducers parallel but it seems unresolved
as I understand it, reducers and fold require you to specify the transformation once and then you have a "machine" for doing the parallel work
but you can't swap in and out aspects of that machine because the parts aren't interchangeable in a sense
Right, on both counts.
@meowy: I do not believe he is. But a lot of people here use his libraries anyway so ask your question and see if someone can help you…?
I'm wondering how to get Tufte's profiling to work when working with transducers. There's a strange little issue I'm having: If I define the transducer within the (profile) form, the profiling works correctly, but if it's defined externally using def, it won't work.
Nevermind, I realized what I was doing wrong. (p) form was getting evaluated outside of my (profile) block because I did a goof, wrapped the wrong forms.
Does &form
in a macro give you any information you don't already have from the macro's arguments other than the name the macro was called with?
@meowy: I like problems that solve themselves 🙂
Good day fellow clojurians!
Does anyone here know of a library or tool tool to help me visualize my closure project? I'm trying to see the namespace hierarchy and dependency graph. I've asked the venerable Google but so far have come up short. Thanks in advance 🤓
https://github.com/hilverd/lein-ns-dep-graph might be a starting point
So cool. Thanks again!