Fork me on GitHub
#clojure
<
2016-09-17
>
kaosko02:09:24

anybody using mount? how do I check the state of a mount? I have a running thread in a defstate and want to exit it when the mount is stopped

snoonan02:09:33

reagent re-frame reactive and om

snoonan02:09:55

wrong channel

pre03:09:12

what percentage of clj.spec is consistent across clojure and cljs? Are there docs describing their variances?

dhruv06:09:08

@kaosko whatever you refer to will be an instance of mount.core.NotStartedState if not started. check out the #mount channel too

alexyakushev09:09:48

peterwestmacott: Indeed, this is the same problem

alexyakushev09:09:21

For the time being, I replaced the cat transducer in my program with an explicit put! loop

Rachel Westmacott09:09:15

yep, that’s what I did when I hit it too

artur09:09:31

Anyone running clojure on raspberry pi?

pjstadig10:09:04

@artur i looked into it a while ago. You need the oracle JVM because the ARM JIT isn't open source (or wasn't at the time)

pjstadig10:09:17

i don't even remember if I got it working or not

pjstadig10:09:56

i kind of quickly switched to installing an NES emulator and bought some USB nintendo controllers so my wife could destroy me at Dr. Mario

elahti11:09:12

i ran at some point clojure on raspberry pi. wouldn't do it anymore since the bootup time of the jvm is just so long.

elahti11:09:16

i'll just go with node next time

matan12:09:33

hi, can anyone easily explain item 8 on http://clojure.org/reference/refs? > If a constraint on the validity of a value of a Ref that is being changed depends upon the simultaneous value of a Ref that is not being changed, that second Ref can be protected from modification by calling ensure. Refs 'ensured' this way will be protected (item #3), but don’t change the world (item #2).

matan12:09:37

I get it all until "don't change the world" where my understanding crumbles like a house of cards

matan12:09:09

How can they change the world if they are protected from changing? surely my core understanding is lacking

Shantanu Kumar12:09:54

@matan The protection is due to snapshot isolation and maintaining history — the txn may be retried if anything changes, hence the protection — ensure is like asking other concurrent txns to not touch that particular ref

Shantanu Kumar12:09:29

From ensure docstring: “Protects the ref from modification by other transactions. Returns the in-transaction-value of ref. Allows for more concurrency than (ref-set ref @ref)”

eraserhd14:09:04

I have just made the channel #composition, the purpose of which is discussion of math and logic around making things compose, combinators, this aspect of transducers, and so forth.

eraserhd14:09:41

Also, perhaps a good place for, "How do I make this @#!% thing compose?"

lsenta14:09:05

Hi guys, do you know how to use prismatic schema to match: - a vector, [s/Keyword [s/Keyword s/Keyword]], for example - and have a schema that check for required keys only, so that (def MySchema {:required …}) pass with {:required … :more-value …}

gfredericks14:09:55

[(s/one s/Keyword) (s/one [(s/one s/Keyword) (s/one s/Keyword)])]

gfredericks14:09:09

and {:require ..., s/Keyword s/Any}

lsenta14:09:58

@gfredericks thanks a lot! with names it works perfectly (s/one s/Keyword :a-field)

matan15:09:27

@kumarshantanu thanks. to be used sparingly then I guess, as it pretty much locks down any other transaction from touching the ensured ref.

matan15:09:12

Still no clue why this says "Ref that is not being changed" and "but don't change the world" together. Feels like a conundrum, so I am probably missing something big. >If a constraint on the validity of a value of a Ref that is being changed depends upon the simultaneous value of a Ref that is not being changed, that second Ref can be protected from modification by calling ensure. Refs 'ensured' this way will be protected (item #3), but don’t change the world (item #2).

Shantanu Kumar17:09:17

@matan I’ve realized the utility of ensure is in creating invariants, among other things. Let’s say there are two refs A and B each referring to respective integers, and the invariant is: their sum must never go out of the range 10-to-20 at any point of time. Transaction t1 reads A and updates B, whereas transaction t2 reads B and updates A. Since t1 and t2 may run concurrently they may not be coordinated to maintain the invariant. In such cases you can use ensure to stop the other txns from touching certain refs (instead of resorting to a coarse-grained lock) hence improving concurrency.

Shantanu Kumar18:09:24

Retried transactions would see a consistent ref world, but ensure may often cause a cheaper retry

michaelmrose23:09:29

anyone use puget.printer and understand how to customize its :color-scheme property?