Fork me on GitHub
#clojure-uk
<
2019-03-29
>
dominicm09:03:16

my eyes feel itchy. is it hayfever season already?

Ben Hammond09:03:44

could be; trees in my garden were showing blossom in February

Ben Hammond09:03:50

which is wierd

dominicm09:03:59

trees in MK have started blossoming, they look quite lovely

Ben Hammond09:03:18

blossom -> pollen ?

3Jane09:03:31

it is pollen season unfortunately 😞

3Jane09:03:08

random on topic question, what’d you use if you wanted to have a lazy sequence and get the last element that doesn’t change?

3Jane09:03:22

as in: (7 5 3 1 1 1 1)

3Jane09:03:24

you’d want 1

Ben Hammond09:03:13

(drop-while (partial apply not=) (partition 2 ... kinda thing?

Ben Hammond09:03:47

equals close bracket becomes smiley

3Jane09:03:41

…huh, I haven’t thought of that

3Jane09:03:32

I found myself wishing reduced worked for iterate 😄

Ben Hammond09:03:28

well; reduce is fundamentally eager and could go for ever unless you break out of it iterate is lazy, so you just stop harassing it; it doesn't need to break free

dharrigan10:03:42

Cue Queen song...

3Jane11:03:26

bit more verbose

3Jane11:03:32

(ffirst (drop-while #(not= (first %) (second %)) (iterate rest s)))

3Jane11:03:07

…though actually the cost of repeating 1 more time than strictly necessary is not that large, partition is better 🙂

Ben Hammond11:03:09

not= will short-circuit so you can (first (drop-while #(apply not= %) (iterate rest s)))

Ben Hammond11:03:51

the apply will generate a bunch of new cons cells though

Ben Hammond11:03:09

ah no that's wrong

jasonbell09:03:30

Interestingly most of my hayfever issues seemed to be Pollen + Pollution, since I moved to NI I don’t get hayfever anymore

👍 4
dominicm09:03:59

@lady3janepl how do you know it doesn't change?

jasonbell09:03:08

@dominicm If you start welding and singing “What a Feeling” from Footloose we know why.

3Jane09:03:30

er… b/c of how I wrote the function that generates the sequence

dominicm09:03:50

@lady3janepl I think generally the answer is loop or reduce

3Jane09:03:01

right, so hand-roll

3Jane09:03:02

thanks 😄

thomas09:03:34

I would go with @ben.hammond idea in the thread... something with partition

Ben Hammond09:03:02

swings and roundabouts really

thomas09:03:57

I once had a similar question in an interview... you have a sequence of numbers, keep going till the number decrease: 1 2 3 5 8 3 4 5 so stop at 8.

dharrigan10:03:48

I'm curious, how did you solve that?

benedek15:03:21

suppose you can do it with a loop where you take the first two elems, compare them. either return or recur with rest of coll

Ben Hammond09:03:59

did you get the job?

thomas09:03:47

no... it was at the bank we previously discussed... that was the good part... the not so nice part came afterwards.

😢 8
3Jane11:03:05

glad to see you’re growing 👍

Conor12:03:57

I was about to make fun of you for saying 'competitive' salary, but it actually tells you a range when you click through 🙂

3Jane12:03:13

yeah, functional works are nice like that

3Jane12:03:35

I wonder why it doesn’t show in the slack integration, maybe they’re avoiding scraping?

thomas12:03:37

in the #clojure-europe channel it does show the salary range :thinking_face:

maleghast13:03:26

I was updating it to show a range when I posted it - I think it’s a caching / publishing error

👍 4
practicalli-johnny14:03:29

@maleghast does Clojure and ClojureScript count as "programing in more than one language" 🙂

Olical14:03:58

Hah, wondered why I got a notification 😛

maleghast14:03:54

Not really, but I find it hard to imagine that anyone applying for this would only have programming experience in CLJ & CLJS 😉