Fork me on GitHub
#clojure-uk
<
2018-05-31
>
seancorfield04:05:15

Your comment about DropBox and migrating to a new Mac struck a cord... I'm soon to migrate from a Mac to a Windows box and I've been wondering about ways to make the transition easier...

seancorfield04:05:05

...I already run Parallels on the Mac with Windows 10 for all my non-dev stuff, relying on Docker (Mac) and Terminal for dev stuff. The plan is to run Docker (Windows) and WSL/Ubuntu for dev stuff after I switch.

korny07:05:11

@seancorfield I moved most of my stuff to DropBox when they bumped paid accounts from 100G to 1T 🙂 Also I heavily use duplicity to back up stuff I don’t want to share with whoever manages to hack DropBox

thomas07:05:06

mogge 😼

3Jane07:05:34

I’m learning Python (for Reasons)

3Jane07:05:48

sometimes it’s refreshing

3Jane07:05:58

sometimes I can’t figure out what someone was thinking

3Jane07:05:38

You can define a lambda (aka short anonymous function) using variable names that don’t exist inside its body. Then you can use it in scope where variable with that name was defined, and it’ll use that variable.

3Jane07:05:01

This just seems like a recipe for unexpected side effects and bugs.

😱 8
agile_geek07:05:47

Bore da welsh_flag

👋 4
otfrom07:05:52

mmm... magic

otfrom07:05:59

and morning

mccraigmccraig07:05:20

that’s a “srsly wtaf” feature @lady3janepl

😂 12
💯 4
otfrom08:05:57

I think that is what always confused me about zope, but then I never understood or used it enough to properly understand what was confusing

guy08:05:44

morning folks!

3Jane08:05:26

(…just found out it’s not restricted to lambdas, if you use a var name and it’s not been declared in current scope as local/nonlocal/global, it’ll just keep checking up in parent scopes as they are at the moment of invocation. 😱 )

3Jane08:05:47

(I’m so used to people bitching at PHP and being proud of Python that I somehow expected better. Python, dear, I’m not angry, just disappointed.)

😂 4
guy08:05:16

I would argue, just because you can do something in a language doesn't mean you should

3Jane08:05:07

it’s not about what you should do, it’s about what can happen if you mistype something.

3Jane08:05:31

same as with if ($x = 1) instead of ==

agile_geek08:05:17

Hmmm, same could be said for mistyping stuff in any dynamic language tho?

3Jane08:05:53

no, because side effects are limited to the internals of the function. it’ll always be wrong in the same way.

3Jane08:05:18

vs. a function that will be wrong in different ways because it’s been invoked in different environments

agile_geek08:05:40

True. Constraints and consistency are wonderful things.

3Jane08:05:22

(TIL, original Lisp also had dynamic scoping. I started with CL so never realised.)

yogidevbear08:05:01

Morning 🙂

👋 8
yogidevbear08:05:25

Heading into Londontown for my last day as a full time cfml dev. From tomorrow it's full time Clojure 🎉

✔️ 24
🎉 20
bubblebobble 12
yogidevbear08:05:51

I'm struggling to contain my smile

guy08:05:08

Thats super exciting 😄

yogidevbear08:05:27

Time to really start learning Clojure at max pace

guy08:05:19

What are you going to be doing if you dont mind me asking?

yogidevbear08:05:22

Clojure 🙂 I'll find out more tomorrow

👍 12
alexlynham11:05:29

Also where are you working?

seancorfield16:05:41

@alex.lynham CFML == ColdFusion... That's how @U0MFQNXFZ and I met. I was working at Macromedia when they acquired the company that created CFML, so I got to know a lot of CFML devs.

👍 8
seancorfield16:05:28

And where I work used to be a CFML shop. I migrated them to Clojure 😇

👍 4
dominicm08:05:26

@lady3janepl elisp works that way too

dominicm08:05:30

messed with my head.

yogidevbear08:05:45

Not sure who else has had to deal a lot with timezones or calendar systems on their dev career, but if you have, you'll probably enjoy this read https://zachholman.com/talk/utc-is-enough-for-everyone-right

3Jane09:05:19

yeah I avoided that because I have too many fragile objects in the environment

3Jane09:05:43

but if you’ve already tested … 😄

korny10:05:33

I’m finding it is actually worse in the UK than Australia - here, bad timezone code can work accidentally for several months of the year. In Aus, well, if a report is 9 hours out you generally notice…

yogidevbear11:05:32

☝️ this, definitely!

jasonbell09:05:14

morning

👋 4
bronsa09:05:32

morning

👋 4
bronsa09:05:16

@lady3janepl <ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-453.pdf> has a good section on how lexical scoping emerged in the lisp family

danm09:05:43

Ello ello ello :male-police-officer::skin-tone-2: :female-police-officer::skin-tone-2:

👋 4
maleghast09:05:59

Morning!

👋 4
korny10:05:06

I wonder if Python has a linter that warns about that? One of the things I’ve really enjoyed about ES6 work is how good eslint and it’s pals are. Makes working in a dynamic language much nicer, when your linter tells you about unused variables or dangerous code practices,

3Jane10:05:18

possibly. they have a lot of style restrictions. it’s just weird that in a language that puts so much weight on clarity and doing things ONE way, they allow it

3Jane10:05:37

by reputation, I’d maybe expect it in ruby or perl (as they’re known for magicky weirdness)

alexlynham10:05:00

@korny is eslint an npm package then?

korny11:05:33

@alex.lynham yep. Both Atom and IntelliJ can read .eslintrc files as well and give you hints when you break the rules.

alexlynham11:05:07

I'm still on the sublime hype but will have to give it a go

mccraigmccraig11:05:21

if y'all aren't already using it - joker is a useful clojure/script linter - https://github.com/candid82/joker - with various editor integrations

😍 4
3Jane11:05:39

oooh adhoc scripting with clojure?

korny11:05:11

@mccraigmccraig ooh - looks very neat.

mccraigmccraig11:05:29

it tells me quickly when i've got typos and unused bindings, which is enough to be useful

jfacchini11:05:36

Hi @thomas, thank you !

otfrom12:05:15

TIL: (try (throw "foo") (catch Throwable t (Throwable->map t)))

😀 4
otfrom12:05:25

which blows up in the wrong way teaching me the right thing. 🙂

dominicm12:05:51

Would (Thread/getStackTrace) work with (Throwable->map)?

danm12:05:46

What bit was the L?

otfrom13:05:28

Throwable->map

otfrom13:05:43

(which I might have learned at some point, so it is probably re-learned)

mccraigmccraig13:05:00

i only learned of Throwable->map a few short weeks ago... i don't think i'd ever tried to serialize an exception before then

danm14:05:13

It's really quite handy, sometimes

danm14:05:34

Why does Clojure take so bloody long to compile on my Mac... It's fast on the Jenkins instance we have on AWS, and that's not very big. This mac has an SSD

guy14:05:09

Does it take that long? o.0

guy14:05:30

How are you compiling it?

alexlynham14:05:03

Throwable->map? This is new to me but will def spam that

danm15:05:06

@guy boot build

guy15:05:34

Sorry i've not used boot before 😞 I heard it was supposed to be faster :man-shrugging:

dominicm21:05:30

How is build defined?

danm21:05:11

Can’t recall off the top of my head (pom) (aot) (uber) (jar) (target) I think

dominicm21:05:21

One thing that immediately stands out: perform a sift between jar and target.

dominicm21:05:31

You can massively reduce copying

danm15:05:25

Took over 10 minutes to compile a 200 line script, most of which was spent in Writing target dir(s)...

danm15:05:52

If you had to build a high performance time-based queue, what would you use (lib or technology)

guy15:05:20

Today i learnt about some-fn existence. https://clojuredocs.org/clojure.core/some-fn Still not 100% sure why it would be useful

bronsa15:05:17

(some (some-fn int? string?) [:a 'b "c"])

😅 4
guy15:05:56

isnt that the same as ((some-fn int? string?) [:a 'b "c"]) :thinking_face: ill try it out!

jarohen15:05:58

we occasionally use it for transformations - (map (some-fn {:a :b} identity) [:c :d :a :f :g]) -> [:c :d :b :f :g]

👍 20
🅰️ 4
2️⃣ 4
🅱️ 4
bronsa15:05:26

@guy no some-fn is a combinator, it’s not a collection op

👌 4
jarohen16:05:05

or (filter (some-fn div-3? div-5?) coll) - like a higher-order or

guy16:05:33

ooh ok that looks quite nice

jarohen16:05:38

instead of (filter #(or (div-3? %) (div-5? %)) coll)

bronsa16:05:41

yep some-fn is for all these times you’ve wishes “man, I wish I could use or in a filter/map but it’s a macro`

guy16:05:42

yeah exactly

bronsa16:05:48

every-fn for and

bronsa16:05:12

every-pred rather

bronsa16:05:27

@jarohen it’s been a while :)

😄 4
bronsa16:05:36

haven’t done much clj lately

😭 8
jarohen16:05:00

ooh, I tell you where we've also found it useful - composing ring handlers:

(defn sub-handler-1 [req]
  (when (do-i-want-to-handle-this? req)
    (response "foo")))

(defn sub-handler-2 [req]
  (when (do-i-want-to-handle-this? req)
    (response "bar")))

(defn sub-handler-3 [req]
  (when (do-i-want-to-handle-this? req)
    (response "baz")))

(def main-handler
  (some-fn sub-handler-1
           sub-handler-2
           sub-handler-3))

❤️ 20
agile_geek07:06:01

That’s pretty cool. Shame I’m not likely to be able to use it professionally! How’s things James?

otfrom16:05:50

oooh, that is sweet