Fork me on GitHub
#portland-or
<
2015-11-06
>
russ15:11:00

hello clojure-pdx!

howardabrams18:11:01

Good morning, Knights that used to call themselves Clojerks!

bill23:11:54

finishing up my last Ruby project…um…soon

russ23:11:07

@bill: How about some internal clojure lib therapy?

russ23:11:34

class Atom
    def initialize(value)
      @value = value
      @mutex = Mutex.new
    end

    def deref()
      @mutex.synchronize {
        @value
      }
    end

    def reset(value)
      @mutex.synchronize {
        @value = value
      }
    end
  end

russ23:11:59

you can implement swap the same way if you need it simple_smile