Fork me on GitHub
#clojure-uk
<
2019-05-23
>
seancorfield05:05:10

~/.lein/profiles.clj is evil. Can I just say that?

seancorfield05:05:24

Maybe Leiningen is evil too...?

seancorfield05:05:32

Trying to help beginners and they have a dependency problem not caused by project.clj but they insist they have no ~/.lein/profiles.clj file 😞

dharrigan05:05:33

That threw me at the start too, I had a bad profiles.cljand I couldn't work out why nothing was working...

dharrigan05:05:11

I didn't understand the relationship between profiles.clj and a project.clj. Had to figure it out.

seancorfield05:05:39

rm ~/.lein/profiles.clj -> happy life!

seancorfield06:05:50

I don't recall this problem happening with boot or clj....

seancorfield06:05:08

I think Leiningen's plugins are generally "evil"...

dharrigan06:05:35

I'm still a bit undecided between lein and clj, lein is the incumbent and has great support etc., clj is the upstart with a lighter feel.

seancorfield06:05:32

At this point I don't know of any reason to use lein instead of clj πŸ™‚

seancorfield06:05:26

(but then we switched from lein to boot completely in 2015 and from boot to clj completely in 2018)

dharrigan06:05:09

Yes, I do think clj is where it's at

dharrigan06:05:26

but it's soooo easy to do lein new app foo

seancorfield06:05:45

clj -A:new app foo

djtango15:05:13

I came across this when googling for something - thank you so much for putting this together, it's a great idiot-proof way around deps.edn

seancorfield06:05:21

Seriously, I haven't touched lein for years...

dharrigan06:05:49

I think you've convinced me to spend more time looking at clj

dharrigan06:05:59

I'm an easy pushover at this time of the morning

seancorfield06:05:58

I think it's really important to get back to "simple" and that's what clj/`deps.edn` is all about.

seancorfield06:05:24

lein/`boot` have so much "magic" that I just can't get behind them any more.

seancorfield06:05:55

(this Brit's about to go to bed, once I've finished this beer)

seancorfield06:05:39

(Figueroa Mountain Imperial IPA)

jasonbell06:05:05

Hi @seancorfield all well with you sir?

seancorfield06:05:14

Very well! πŸ™‚

jasonbell06:05:41

Excellent news and with IPA, all the better πŸ™‚

seancorfield06:05:08

Is there anything happening in the UK around the middle of August?

seancorfield06:05:51

My wife has been invited to judge a cat show in Stoke-on-Trent so we'll both be coming over for about a week...

seancorfield06:05:54

Thpprpppprttt!

dharrigan06:05:57

Of course, August of which year is totally up in the air atm πŸ™‚

jasonbell06:05:37

@seancorfield I’d just vanish in to the Emma Bridgewater shop in Stoke and stock up on tableware.

seancorfield06:05:54

Well, we'll arrive probably August 15th in Heathrow and leave August 20th.

jasonbell06:05:42

You could be Terminal Man for the week….. cheaper items in duty free shopping.

seancorfield06:05:16

Yeah, that's probably the most exciting aspect about visiting Britain...

dharrigan06:05:30

I'm sure you've googled, but here's a link for you anyway

jasonbell06:05:41

It’s no secret I love airports @seancorfield

dharrigan06:05:51

From the looks of it, you can get all the fine meat, sausages and ham you want!

seancorfield06:05:55

My fam is from that area πŸ™‚ @dharrigan

dharrigan06:05:20

ah, then you're asking the wrong person. I'm Irish....

seancorfield06:05:59

I was born'n'raised in N.Ireland. But my fam's from Walsall/Wolverhamton.

seancorfield06:05:11

How am yer? Alright?

dharrigan06:05:11

Norn Ireland

dharrigan06:05:25

(or Norn Iron)

jasonbell06:05:38

πŸ™‚ I live in NI….

seancorfield06:05:57

It's not what it used to be @jasonbell

dharrigan06:05:09

Seen any dragons lately @jasonbell?

jasonbell06:05:22

I’m sure not @seancorfield I’ve lived here 15 years now.

jasonbell06:05:44

@dharrigan no but the number of tourists is spiked, they’re annoying now on the coast.

seancorfield06:05:50

It's been well over 20 years since I was last there...

seancorfield06:05:07

I was born in Belfast General in '62

jasonbell06:05:37

I’m on the NW side, nicer, quieter.

seancorfield06:05:49

I still love N.I. but tainted by bombs going off πŸ™‚

seancorfield06:05:07

We lived in Coleraine for a while.

jasonbell06:05:24

Still small pockets of annoyance that go on, it’ll never go away.

jasonbell06:05:37

I’m 15 mins away from Coleraine, I’m in Limavady

seancorfield06:05:51

My dad was told to leave by N.I. police as he was on the IRA list... 😞

seancorfield06:05:08

He moved us to Guildford (really dad? Guildford Four?)

seancorfield06:05:39

And I ended up in Aldershot. Blew up the line behind my house. Sigh.

seancorfield06:05:46

Still, I have a lot of sympathy for the IRA to be honest.

jasonbell06:05:08

I’ve heard tons of horrific and worrying stories so non of it is a surprise anymore. We all thought it might get better then my friend got murdered in April……

seancorfield06:05:04

It's a whole bunch of shit, to be honest, no matter what "side" you're on.

jasonbell06:05:38

@seancorfield Oh for sure. I did a lot of freelance press photography in 2006-2008 so I heard all sorts of nonsense.

seancorfield06:05:39

I was born in 62 in N.I. We moved back to the mainland in '69. It was all shit back then.

jasonbell06:05:00

but getting the most hardened of IRA supporters to sing into a hairbrush was a high point. β€œWhat’s in it for me Jase?β€œ, β€œThe difference between page 1 and page 3, you’re call.β€œ, β€œGive me that hairbrush…”

seancorfield06:05:17

LOL :rolling_on_the_floor_laughing:

seancorfield06:05:37

Americans are totally freaked out by all of this BTW.

jasonbell06:05:26

Not a surprise.

alexlynham06:05:35

Remember to vote today

dharrigan06:05:27

I wouldn't know who to vote for

thomas07:05:14

I have already voted today on a pro-Europe party.

πŸ‘ 16
dharrigan07:05:15

I may vote Lib Dems, but I can never in my heart forgive them for their betrayal of students

practicalli-johnny09:05:44

It's funny that people forget that Labour introduced student tuition fees. Then the LibDems managed to minimise the rise of tuition fees as a minor partner in a coalition government. The the Conservatives all voted to hike the fees up to 9k a year.

practicalli-johnny09:05:14

Had more people voted for LibDems then they could have been in charge of government and scrapped tuition fees.

practicalli-johnny09:05:44

And your initial statement does neglected all the other things the LibDems did to minimise the impact of austerity (kept it lower impact than Labours pledge). I could go on, but don't want to rant (too much)

dharrigan07:05:40

Some wounds just cut too deep

🎱 4
4
4
4
πŸ’© 4
😠 4
🀷 4
Ben Hammond07:05:15

at some point, emoticon will have to become recognised as an official written language

Ben Hammond07:05:43

but noone will be able to agree on what all the glyphs mean

dharrigan07:05:05

Didn't Egypt figure it out a few thousand years ago?

3Jane07:05:30

yeah, and they switched to alphabetic

3Jane07:05:49

created by associating glyphs with sounds of their words πŸ˜„

3Jane07:05:20

everything old is new again 🎡 but now that we have computers to remember and write things for us, writing in glyphs is a saner proposition

3Jane07:05:33

random question, does anyone know someone from Arm?

3Jane08:05:09

@seancorfield re what to do in August, idk what you find entertaining but there's usually historical recreation battles running in the countryside πŸ˜„

dominicm08:05:02

The Stoke on Trent art Museum has a Staffordshire hoard display

otfrom08:05:55

voted today

alexlynham08:05:41

in my area not voting means you get tommy robinson

4
4
danm08:05:08

Milkshakes at the ready

πŸ˜‚ 8
thomas08:05:51

I love the smell of milkshakes in the morning....

dharrigan08:05:47

Found this on b3ta yesterday - made me chuckle:

dharrigan08:05:58

milkshake appropriate

3Jane08:05:16

well now I'm hungry πŸ˜„ ok, off to vote o/

thomas09:05:06

ttfn... and enjoy your milkshake!

πŸ˜‹ 4
practicalli-johnny09:05:13

Interesting website in case you are making any voting decisions today https://www.helpsavedemocracy.com/brexit

practicalli-johnny09:05:08

I voted LibDems and happy to see them in the top two in the polling. I hope there is a high voter turn out so that parties without policies get fewer seats.

practicalli-johnny09:05:38

If you don't vote today, it does means more publicity for Nigel Farage...

guy09:05:46

Morning folks!

guy09:05:53

Happy Thursday πŸ˜„

thomas11:05:04

on the Guardian are reports of EU nationals in the UK who are not allowed to vote :face_with_symbols_on_mouth:

practicalli-johnny11:05:49

Stopping people voting is a very Brexit type of democracy 😞

dharrigan12:05:22

I know completely off topic, but man, really enjoying REPL driven development - being able to hit a REST API, examine the results, tweak the function, re-eval, and retry is really a nice experience.

πŸ‘Œ 12
βœ… 8
dharrigan12:05:41

Sorry for interrupting the politics πŸ™‚

guy12:05:17

πŸ˜„

guy12:05:42

A classic repl gotya is the difference between using map in the repl and map in code

guy12:05:16

When i first started using clojure i would always make the lazy mistake and use map in repl then wonder why i would get some lazysequence@... or something like that in my code πŸ˜‚

guy12:05:02

So just remembering repl evaluates your map so its not lazy is something even now i remember πŸ˜‚

πŸ‘ 4
guy12:05:10

(hopefully that makes sense :thinking_face: )

dharrigan12:05:32

That's a handy hint!

πŸ‘ 4
practicalli-johnny12:05:15

@guy sorry, not following you. Do you have an example to try?

practicalli-johnny12:05:39

I rarely use the REPL buffer (window) directly, wondering if I am missing something

guy12:05:18

mmm im trying to come up with an example and its not working πŸ˜‚. I think it was more to do with my work flow i guess when i first started.

guy12:05:00

I’ll see if i can recreate it and ill ping you @jr0cket

guy12:05:26

I think this is a sorta contrived example but

guy12:05:53

(->>  [1 2 3 -3] 
     (map identity)
     (filter pos?))
=> (1 2 3)
I do something like this in my repl and as a newbie i was like oh cool it does what i want

guy12:05:24

Then i would have done something like this

guy12:05:00

(defn guy-fn [coll]
  (let [result (->> coll
                    (map identity)
                    (filter pos?))]  
  (println result)
  (str result)))
=> #'user/guy-fn
(guy-fn [1 2 3 -4])
(1 2 3)
=> "clojure.lang.LazySeq@7861"

guy12:05:32

So i just take the code i had used in my repl without thinking and am surprised that it was a lazyseq if that makes sense?

guy12:05:06

It used to get me all the time starting out with clojure because of the understanding of what functions are lazy and eager, but in the repl it sort of doesn’t matter ( i know it does but yeah)

guy12:05:31

Either way it might just be something that only happened to me, but i remember it catching me off guard quite a few times πŸ˜‚

guy12:05:37

@jr0cket hope that makes sense?

thomas13:05:05

is there a function who's whole purpose is just to be eager and otherwise just a NOP?

thomas13:05:57

In the past I have just used println for that... but that isn't ideal as it generates lots of stuff potentially.

practicalli-johnny13:05:37

I have created code that results that are just a reference to something that will lazy evaluate. I typically put that in a function definition to fix most things (although not all)

practicalli-johnny13:05:57

Most of Clojure is eagerly evaluated, I think its mainly around sequences where its specifically lazy, especially of course lazy-seq. The do family of funcitons might help eagerly evaluate things, but I need to go and read some more about that...

practicalli-johnny13:05:03

@guy I see what you mean now, thanks

zyxmn13:05:39

@guy Story of my life

πŸ˜„ 4
practicalli-johnny14:05:31

If you call your example as an in-line function, then it returns the answer

((fn [coll]
   (let [result (filter pos? (map identity coll))]
     result)) [1 2 3 -3])

practicalli-johnny14:05:49

unless you wrap the answer in a str call

((fn [coll]
   (let [result (filter pos? (map identity coll))]
     (str result))) [1 2 3 -3])

practicalli-johnny14:05:12

@thomas "Lazy sequences can be forcefully realized with clojure.core/dorun and clojure.core/doall. The difference between the two is that dorun throws away all results and is supposed to be used for side effects, while doall returns computed values:" There is a nice write up here: http://clojure-doc.org/articles/language/laziness.html

guy14:05:58

Yeah its even worse because the first i would do as noob is use println to debug

guy14:05:14

But because println evaluates? the form it would give the right answer

guy14:05:42

Either way that was defo a learning by mistakes sort of time πŸ˜„

dharrigan14:05:28

I'll have to get a few slides together

zyxmn15:05:52

@dharrigan would you be posting the slides anywhere public when you are done πŸ˜› ? I misread as you already had a presentation ready

rickmoynihan15:05:34

@thomas There are a bunch of functions/tricks in those cases… doall/`dorun` that @jr0cket mentioned. Also run! is like an eager map of a procedure over a collection. i.e. where you want a side effect for each value, rather than a return value. Other tricks to eliminate laziness in a sequence are to wrap a vec over it, or use into etc which can help isolate/eliminate computations in the lazy seqs from being measured.

πŸ‘ 4
dharrigan15:05:39

Maybe, depends πŸ™‚ It's going to be a simple set of slides, using the

dharrigan15:05:04

Mostly, it'll be showing a program and repling like a mad repily type of person

dharrigan15:05:20

I have a nice (I hope!) demo of a port of a kotlin program to clojure that works. I'm going to have a branch with some of the features removed and show how I can "add" them back in again by using the repl

dharrigan15:05:28

to restore the functionality

dharrigan15:05:48

before that, I'll start with some basic "LISP 101" stuff and why Clojure is all warm and cuddly

zyxmn15:05:24

awww no giphy integration in this channel 😞

zyxmn15:05:33

@dharrigan I wish you luck !

dominicm17:05:38

Sent looks awesome

dharrigan18:05:53

It's great - used it before, it's just as minimal as I like it πŸ™‚

practicalli-johnny18:05:42

@dharrigan good luck with your presentation tomorrow. You remindedm me that mine are a little out of date now, I should update / delete them http://jr0cket.co.uk/slides/

dharrigan18:05:13

It's a little program that displays slides, that utilise a minimalistic way of presentation.