Fork me on GitHub
#clojure-uk
<
2020-04-16
>
Wes Hall00:04:36

@folcon It's all in my muscle memory, but isn't it CTRL-c CTRL-e?

flefik16:04:14

Isn’t that to batch edit results in a search?

dharrigan04:04:37

Good Morning!

dharrigan05:04:36

How are you today?

dharrigan05:04:41

or, rather, this night?

seancorfield06:04:36

Binge-watching Hawaii Five-O Season 10, drinking beer, and just about to go to bed 🙂 Our routine is all over the place at this point.

guy07:04:32

Morning!

guy07:04:45

I have to say i've really been enjoying the sunshine these last few days

guy07:04:55

Makes self isolation semi bearable ^^

Johanna07:04:04

Morning ☀️ same here

☀️ 4
guy07:04:52

I think if this had happened of xmas it would have been so terrible haha

alexlynham08:04:55

on the js front - add eslint as a precommit hook, enforce one function style, prefer arrow functions, disable any var usage in favour of const... and you're most of the way to a decent lang

dominicm08:04:28

Arrow functions look weird.

alexlynham08:04:33

although pervasive, always on async behaviour gets tiring after a while. sometimes when ya don't need it the extra overhead of async is wearing.... to me, anyway

alexlynham08:04:10

yeah I'm not a fan of the syntax, but getting rid of the baggage of yeah it's also a type with this binding and whatnot is valuable imo

dharrigan08:04:27

which function style do you recommend?

alexlynham08:04:49

unless there's an amazing reason for it, I prefer always arrow fns

dominicm08:04:53

The this thing is nice. That's always a nightmare.

alexlynham08:04:54

(for new projects)

dominicm08:04:11

@alex.lynham I assume you mean for anonymous, not named?

alexlynham08:04:26

if you have an older code base I like adding the eslint rule that forces one function style for named as well

alexlynham08:04:43

so you either have all fns hoisted or none, ya know?

alexlynham08:04:14

@dominicm well, you're able to shuffle them into a const anyway, so both I guess

dominicm08:04:16

I think my brain can't handle that. Not for any reason.

alexlynham08:04:36

lol was just looking at some side project code and it uses 2/3 types of fn, oh well. I'm more disciplined when somebody else is paying me I swear haha

😂 4
👍 4
dominicm08:04:51

Arrow functions feel like they were for anonymous, not for named. Not for any reason.

alexlynham08:04:03

yeah I think that's the intention

dharrigan08:04:26

Can you share your eslint?

alexlynham08:04:30

but because they strip some of the OO indirection, in a functional or rx code base you can use them as your main type of fn

dharrigan08:04:35

curious minds want to know 😉

alexlynham08:04:23

html comments work

alexlynham08:04:31

@dharrigan the rules in question are off the top of my head no-var and config around func-style

dominicm08:04:00

The goes to operator is the one that really messed me up

alexlynham08:04:04

yeah, that must have slipped down the ol memory hole for me too

dominicm08:04:30

I guess the downside to enforced arrow is that some API give you a meaningful this

dharrigan08:04:36

Man, I just love being able to ssh to my machine at work, fire up a repl and work on code 🙂

alexlynham08:04:43

yeah I think from memory the last large project I did we did prefer non-hoisted, prefer arrow and then caught it in code review, although I can't think of many APIs in redux/react land that had lots of this ing

alexlynham08:04:53

a fair bit in the UI as I recall

alexlynham08:04:57

I think that would have been from react class use, but it was a couple of years ago so don't fully recall. remember that most of the selectors and actions and whatnot were pretty clean and functional, p easy to test with pure data

alexlynham08:04:22

I remember there were 1700 tests with a couple expectations per test and it ran in 29s

dominicm08:04:48

> Could it be that n –> 0 is really just n– > 0 (n minus minus is greater than zero)? So n-- > 0

guy09:04:23

How do people even find stuff like this haha

guy09:04:38

oh nvm they say haha

dominicm09:04:10

Why is nobody listening to Alex! Internal. Do not use!

😄 4
guy09:04:04

Dumb question, but what does that mean. Like is that a util function which is public but can change at anytime so only devs who work on clojure should use it?

dominicm09:04:25

More like, it was added as an idea and experimented with, but never documented. Not part of the API that is promised to stay.

👍 4
dominicm09:04:57

It may be used internally by clojure

👍 4
folcon09:04:09

Isn’t this the same as people creating macros to do the same thing?

folcon09:04:55

I mean obviously, you don’t need to use a method marked internal, as it may change etc, but it feels like the path is there for this sort of thing…

dominicm10:04:20

Exactly, macros work :)

4
rickmoynihan16:04:18

FWIW this is technically a documented feature. It’s documented on the var *read-eval*

rickmoynihan16:04:01

It’s use has always been discouraged though

folcon09:04:49

@wesley.hall You certainly could be right, I was looking up the default shortcuts for a tutorial I’ve been writing and couldn’t find them, so I’m not sure if my memory is correct here at all =)… I’m trying to work out what Send form before caret to REPL and Send top-level form to REPL is for various editor combos… emacs + Cider I thought was CTRL-x CTRL-e, but as you say it might be CTRL-c CTRL-e Intellij + Cursive vscode + Calva appears to be unset vim + fireplace.vim appears to be cp and cpp Anyone who can confirm these would be appreciated!

seancorfield17:04:42

@folcon For Atom/Chlorine, there are no default key bindings but there are examples on the package's home page and CTRL-; b and CTRL-; B are likely the most common (for evaluate block and evaluate top block, which are Chlorine's names for the two commands you listed).

folcon20:04:07

I’ll add it to the list!

guy11:04:45

risky click of the day haha

guy12:04:18

ah was quite cool !

dotemacs15:04:49

Interesting, where did you dig this up?

mccraigmccraig15:04:44

an old colleague in another slack posted it... it was totally random that it had a clojure connection

🙂 4