Fork me on GitHub
#beginners
<
2018-02-12
>
steve17100:02:12

@gonewest818 Yep, that's me. Not too many of us Upstills around.

gonewest81800:02:52

Very nice to meet you!

steve17100:02:17

Back at you! I don't often run into Companion users anymore--though, admittedly, it's been a while since I've been to SIGGRAPH.

awerner3204:02:53

I'm writing a library that deals with geometry and I did it all with points as maps with :x :y keywords. this has some advantages as other types can use point functions but the library works and I'm refactoring it and wondering how strongly I should feel about doing something like deftype or defrecord and how to think about this vs other sins I may be comitting

seancorfield06:02:18

@awerner32 How strongly do you feel about performance vs convenience?

funyako.funyao15611:02:36

Any behaviour difference between put! and >! in core.async other than put! can be attached with a callback and >! must be called inside a go block ?

mateusz.probachta11:02:49

@funyako.funyao156 callback will called when you put! something on channel(channel can have fixed size) and >! will stop execution of go block until something can be added

tbaldridge14:02:24

@funyako.funyao156 >! ends up calling put! so the differences are fairly minimal

tbaldridge14:02:38

>! is basically (call-cc (fn [k] (put! c val k))) if Clojure had cal-cc

c09mld14:02:30

Anyone familiar with cljs-http? I'm trying to use it, but no matter what method or url I use I end up getting a {:status 0, :success false}.

delaguardo15:02:08

You can try debugging options provided by clj-http - https://github.com/dakrone/clj-http#debugging

c09mld15:02:18

I'm not sure the libraries work the same way. Either way it doesn't seem to do much.

delaguardo15:02:58

my bad, sorry. I miss s in library name

c09mld16:02:14

Seems it's not a library issue at all but to do with same-origin policy stuff in the browser.

noisesmith16:02:54

are you seeing browser console messages about CORS headers?

c09mld17:02:01

Yep. Something about * while 'include'

c09mld17:02:06

I only realized I can actually look at the browser console about half an hour ago, so that's the level I'm at when it comes to the web

lee.justin.m17:02:34

i was baffled by that status 0 return too

oliv18:02:29

I’m wondering how good or bad idea is to use alter-var-root function to “decorate” my functions with metrics logic . I mean , if enabled ( collecting some metrics ) I will replace the root-var of some functions with my metric logic and all the code remains the same

tkjone19:02:45

I am new to spec. Is there a way to spec a function that expects an Atom?

tkjone19:02:44

(def arg1 (atom ""))

(defn some-func 
    [arg1]
    ...)

(some-func arg1)

pithyless20:02:41

@tkjone you could spec that it is an (partial instance? clojure.lang.Atom). Unless you want to spec the contents of the atom. Then, don’t. 🙂 Write a function that takes data, returns data; and another that derefs/swaps the atom to provide that data.

tkjone20:02:39

Thanks @pithyless

erhardtmundt22:02:52

I have 2 vectors and I need to calculate their mutual difference using clojure.data/diff

erhardtmundt22:02:19

the problem I have is that I want to define equality for the elements of those arrays in a custom way

erhardtmundt22:02:24

any suggestions?