Fork me on GitHub
#clojure-uk
<
2018-01-15
>
practicalli-johnny06:01:06

Morning everyone. Who would like to give a talk at the monthly London Clojurians meetup on 6th February?

practicalli-johnny06:01:20

Any topics welcome. Personally I would be interested in hearing experiences with Clojure 1.9 and also the new clj and deps.edn command line tools.

practicalli-johnny07:01:28

On a different note, any recommendations for running Leiningen on Windows behind a corporate firewall? It seems running Leiningen on windows 7 doesn't always want to download dependencies, even if you have local mirrors set up. I am encouraging other Dev teams to adopt Clojure, so want to minimise the setup (e.g., avoid setting up local proxy servers or using Loinux environments (Cygwin, msys2). Cursive / IntelliJ seems to play nicely, however it relies on Leiningen, so gets tripped up with the dependencies still.

chrisjd07:01:19

@jr0cket Try setting HTTP_PROXY and HTTPS_PROXY environment variables. This works for me on my Windows work laptop behind a firewall.

practicalli-johnny07:01:13

We had set these environment variable, but still had issues with Leiningen . Then we found a different proxy server to point these variables at and Leiningen worked. So not all corporate proxy servers are equal.

thomas08:01:16

moin moin morning

Rachel Westmacott10:01:44

TIL. Map and Keyword lookup can take a default value, Vector and Set lookup cannot. (without recourse to (get ...))

sundarj10:01:35

symbol lookup can as well

Rachel Westmacott10:01:56

can you call a symbol as a function?

sundarj10:01:18

you can indeed

sundarj10:01:21

works like keywords

Rachel Westmacott10:01:12

TI-also-L: ('get {'get 5}) => 5

reborg10:01:45

('+ 1 1) => 1

yogidevbear10:01:33

@reborg what is going on "under the hood" with that?

reborg10:01:28

symbol can be used as a function to lookup itself in the associative structure passed as first argument (assumed). Symbol didn't find itself there, so returning default value "1"

yogidevbear10:01:33

And picking up the mantle for @peterwestmacott for today... Random core function of the day:

-------------------------
clojure.core/unchecked-long
([x])
  Coerce to long. Subject to rounding or truncation.

yogidevbear10:01:29

user=> ('+ 1 1)
1
user=> ('+ 2 1)
1
user=> ('+ 2 2)
2
user=> ('+ 1 2)
2

bronsa10:01:30

relatedly, there’s also a :syms destructuring

reborg10:01:34

As of unchecked-long, it has very few use cases. I guess the only time I'd use would be in very tight loops where every millisecond counts and you definitely know your numbers are not overflowing (and you need to cast to a long)

reborg10:01:37

(unchecked-long (inc' (Long/MAX_VALUE))) throws with normal long and change the sign in this case

thomas13:01:10

@rickmoynihan don't forget to post in #jobs as well!

rickmoynihan13:01:45

Ahh thanks @thomas

maleghast16:01:16

Yeah @rickmoynihan that looks like a great opportunity; good hunting!

rickmoynihan16:01:34

Thanks @maleghast. It’s a good company, doing some good work. Nice people, smart, humble, considerate.

guy16:01:29

The tech stack looks really interesting too

rickmoynihan16:01:40

It has its challenges for sure, but it’s well suited to the domain. And the challenges provide real opportunities to make some really nice things.

rickmoynihan16:01:52

TLDR; it can be quite good fun 🙂

guy16:01:27

Sorry i wasn’t being sarcastic! If you thought i was 😞

rickmoynihan16:01:55

LOL. No I didn’t. I’m just being honest 🙂

guy16:01:23

😄 cool cool

maleghast16:01:58

Sounds like a great gig - I am not currently looking to make a change, but I will try to remember that you guys are “out there” should my circumstances change… For one thing commuting to Manchester from up here would be simpler, and it is my spiritual home, having been born there and had many formative experiences in Manchester, some in the Northern Quarter FWIW… 😉

danielneal16:01:46

@mccraigmccraig hey you know how you were saying you use promesa with reframe, and have an effect that uses promesa when you want to chain async http calls. Do you write one reg-fz per thing you need to do, or do you use some kind of data-ish abstraction?

mccraigmccraig16:01:35

@danieleneal we've got an effect-per-thing atm - it doesn't happen very often in the codebase

danielneal16:01:50

yeah that makes sense. I think for me login is probably gonna be the main one

danielneal16:01:06

just contemplating approaches again

mccraigmccraig16:01:44

yeah, iirc it was initialising the app which was the first use-case for http chaining

lambdachops17:01:23

@jr0cket You might want to consider running a standard (previously setup) Linux VM on your Windows Desktop and but instead setting the http_proxy/https_proxy environment variables on the vm side similarly as suggested by @chrisjd.

practicalli-johnny07:01:13

We had set these environment variable, but still had issues with Leiningen . Then we found a different proxy server to point these variables at and Leiningen worked. So not all corporate proxy servers are equal.