Fork me on GitHub
#beginners
<
2016-04-20
>
akiva01:04:56

Excellent. There was a time where even our dear @dnolen was a neophyte. Code live, code loud, code earnest. It’s the best way.

echristopherson01:04:41

dancrumb: I'd like to get #C0M8PCF7U going, but lately I haven't had much time to devote to it. But the author is there simple_smile

dharrigan16:04:08

So, trying to get my head around this little snippet:

dharrigan16:04:12

(defn foo 
  [word words]
  (remove #{word} [words])
  words)

(foo "a" ["a" "b" "c"]) 

dharrigan16:04:43

It returns ["a "b" "c"]

dharrigan16:04:52

why not ["b" "c"]?

jeff.engebretsen16:04:10

It looks like the last statement is words. So that’s what’ll get returned.

dharrigan16:04:42

Yus, if I remove words, it returns (("a" "b" "c"))

dharrigan16:04:50

Which I suspect, it's returning the function

dharrigan16:04:01

so words (I think) returns just the data structure

jeff.engebretsen16:04:51

words is already an array. I don’t think you need to re wrap it in the remove statement.

dharrigan16:04:57

(defn foo 
  [word words]
  (remove #{word} words))

(foo "a" ["a" "b" "c"])  

dancrumb18:04:32

the key thing to remember is that (remove) doesn’t mutate words

dancrumb18:04:45

it returns a collection that is the result of its operation on the collection words

dharrigan18:04:03

That's helpful to know. Thank you.

robincarlo8419:04:03

hi guys, do you recommend cemerick/friend for authentication?

dharrigan19:04:18

Last night, i was introduced to Buddy

dharrigan19:04:30

which is based upon bouncycastle

dharrigan19:04:50

I got the impression that it was favoured over Friend.

dharrigan19:04:31

(then, as a side note, introduced to https://jwt.io/)

robincarlo8419:04:40

oh I see, thanks. Will take a look at Buddy.

dharrigan19:04:47

you're welcome.

robincarlo8419:04:48

I'm confused right now if I will need to use an authentication library or just use a simple login by just using cookies.

robincarlo8419:04:58

do you recommend it? I'm just new in clojure, want to know the best practices

dharrigan19:04:37

Oh, I'm totally new to Clojure, so I would not be the best person to ask.

robincarlo8419:04:04

oh I see, I'll just leave my question here and hope someone will answer. Anyway, thanks!