Fork me on GitHub
#beginners
<
2017-12-03
>
jereme00:12:04

Hi @linux.soares - I live in New York City, NY, USA. We have an active Meetup here. I'm pretty new to Clojure, so I have only attended a few times. Each one has been hosted by a different local company that is using Clojure, so the adoption seems to be there.

gilmar23:12:17

Thanks @U86HEM0KX. I started study clojure a short time and would like to know if it is worth the effort and investment. I write some articles about clojure in portuguese… 🙂

jereme13:12:23

Hi @linux.soares - apologies for my slow reply... I was away for the weekend.

jereme13:12:45

I have really been enjoying learning Clojure and am just now starting to do some "real" work with it.

jereme13:12:19

I hope you enjoy it as well. And if I could read Portuguese, I would check out your articles 😉

shaun-mahood00:12:32

Hi @linux.soares. I'm in Edmonton, AB, Canada and use Clojure for work (I'm the only developer and have a lot of leeway on the technology choices) - there's no active meetup here, our monthly attendance was me and one other person, and he just moved so it kind of dissolved. Nubank uses Clojure and @lucascs has given a couple of great presentations at the Conj if you want to find a company in Brazil to talk to as well.

gilmar15:12:31

Hello @U054BUGT4. Thanks! I already went on Nubank, meetup Scaladores, but I never saw Clojure meetup. I wrote some articles about Clojure in portuguese, to help people who do not know English. I was trying to organize some meetup, or study group here, I’m studying Clojure and I’m enjoying it a lot!

jrheard00:12:33

i’m sure there’s an idiomatic way to solve this problem, i’m just having some sort of brainfart: i’m looking for a function that takes two arguments, like [1 4 2 5 4 3 4] and 4, and returns the first argument with a single instance of the second argument removed from it - so in that case it would return [1 2 5 4 3 4]

jrheard00:12:40

should i write my own, or is there something built in that does what i want?

jrheard01:12:16

i ended up with

(defn remove-value-from-hand [hand value]
  (concat
    (take-while #(not= % value) hand)
    (rest (drop-while #(not= % value) hand))))
but i’m sure there’s a more elegant way to do this

jrheard01:12:57

hand is a seq with at most like ten items, so i’m not worried about performance here, just trying to figure out the nicest way to express this function

Bert Weidenflunders01:12:22

hey everyone, I thought you could use anything for keys of a map in cljs, but I'm getting weird output in app.klipse.tech

Bert Weidenflunders01:12:02

I'm entering {a 42 b 43}, but it returns {nil 43}

Bert Weidenflunders01:12:02

actually, I get it now. It's because it thinks a and b are symbols, but I never defined them. derp

ajs01:12:39

You can quote them if you want just symbols

seancorfield01:12:34

@jrheard I'd probably use a recursive function

(defn remove-value-from-hand [hand value]
  (cond (empty? hand) hand
        (= value (first hand)) (rest hand)
        :else (cons (first hand) (remove-value-from-hand (rest hand) value))))

jrheard01:12:56

nice, hadn’t considered that approach, thanks sean!

derpocious04:12:57

hey all, I'm having trouble running this core.async example https://gist.github.com/swannodette/5882703

derpocious04:12:46

but when I run this code it just returns #object[cljs.core.async.impl.channels.ManyToManyChannel]

noisesmith04:12:19

@derpocious go always returns a channel

noisesmith04:12:00

that code should be putting log messages in the browser js console

derpocious04:12:10

ah true. I was looking for it in the klipse console, but I see it now in the dev tools logs.

yogidevbear13:12:18

Hi folks. Any hints as to why (int \5) would return 53?

Ryan Radomski13:12:41

(type \5) returns a java.lang.character. If you reference an ascii table, you will find that '5' is the 53rd ascii characterhttp://www.asciitable.com/

Ryan Radomski13:12:32

you'll find that calling int on any character will return the corresponding position in this table

derpocious20:12:31

Is it possible to have key/value pairs in a set?

derpocious20:12:49

I think the syntax is confusing me because #{ } looks like a map { }

derpocious20:12:16

but a set of more like a list of unique things, right?

derpocious20:12:26

Also, I'm confused whether #{ } is a hash-set or sorted-set. When I do this it returns true

derpocious20:12:33

(= (sorted-set 56 3 2 58 37 15) #{56 3 2 58 37 15})

noisesmith20:12:35

@derpocious (= [1 2 3] (list 1 2 3) '(1 2 3) (map identity [1 2 3])) is also true, but they are different types

noisesmith20:12:06

@derpocious you can put a key value pair in a set, but you can't look up by the key of that pair- a set is indexed by its elements themselves

Drew Verlee20:12:46

does anything detect un-used namespaces?

Arno Rossouw20:12:33

Just curious, why do some programmers make the excuse the code is too complex?

noisesmith20:12:58

excuse for what?

Arno Rossouw20:12:12

Not to start and solve problems

noisesmith20:12:28

because trying to solve problems I can't understand creates more problems

noisesmith20:12:41

and complex code can create problems I don't understand

Arno Rossouw21:12:48

So isn't the answer to break things up into to smaller parts and solve it a step at a time

noisesmith21:12:08

first I need to understand it enough to know where breaking it even makes sense

Arno Rossouw21:12:09

If you never attempt to solve a problem it will remain unsolved

dpsutton21:12:44

This sounds so vague that there can't be a right answer. What prompted this

noisesmith21:12:54

I'm not trying to defend a straw man here - @dpsutton indeed

dpsutton21:12:10

What excuse do people make? I'm not following

noisesmith21:12:31

you asked a question, I thought to myself "when have I said to myself that's too complex I'm not even going to touch it" and gave my answer

Arno Rossouw21:12:36

Its just that it seems that some people like to make excuses rather than apply thought to solve programming issues

noisesmith21:12:46

that's great but it's off topic

dpsutton21:12:25

@noisesmith I'm agreeing with you. I didn't mean for it to sound like calling you out if it did

Arno Rossouw21:12:44

Ok, sorry of topic.

Arno Rossouw21:12:32

I just find that some programmers have it easy by making excuses

noisesmith21:12:02

we have an #off-topic channel

Arno Rossouw21:12:16

Ok, sorry man. Will try that

Drew Verlee21:12:45

For turning a project into a restful server thats going to have a couple api end points that server up JSON responses. SHould i look at anything besides Compojure?

noisesmith21:12:41

sure, compojure is just a router, and there's other good options for routers out there. Liberator has a bunch of things for implementing REST if that's what you need