Fork me on GitHub
#clojure-europe
<
2020-10-02
>
slipset06:10:47

God morgen!

hkjels06:10:29

God morgen!

pez06:10:42

Good morning! My brain is stuck. I have a sequence from which I want to pick n number of items evenly spaced out. So, like take but not the first n. Anyone understand what I am talking about and have an idea about how to go about it? Hmm, maybe I can partition and then pick firsts…

hkjels07:10:35

partition sounds fine

pez07:10:47

Yeah. It seems just asking the question helped. 😃

(->> all
     (partition-all (/ total n))
     (map first))

pez07:10:21

Ah, very nice. I’ll consider if I should use that instead. My use case is that I am producing test data for a unit test suite. Introducing randomness might or might not be what I want. We already have quite a lot of generative testing, so I’m not afraid of random per se. Just need to ponder it a bit. 😃 I might use both, eventually.

plexus06:10:28

Good morning and HAPPY FRIDAY 😸🤡👻

plexus07:10:14

I have a mentee who's getting started with Clojure on a windows machine. Any tips?

dharrigan07:10:37

Yes, reformat and install Linux..... 😛

dharrigan07:10:07

I know, I'm being silly this early morning.

dharrigan07:10:16

I've heard good things about using WSL2 on Windows

👍 9
dominicm07:10:11

Gitbash does work, but wsl2 worked better. I believe John Stevens may have an article or guide on this

synthomat07:10:01

@plexus but what exactly is special about windows? If IntelliJ is an option I would go with that and Cursive

synthomat07:10:51

I even have installed a windows on a VM and use it as a remote Dev-Station. I‘m feeling so filthy 😭

RAMart08:10:17

@plexus Same situation here. We used IntelliJ w/ Cursive in the past. This time we use Atom and Chlorine and a bunch of other Packages.

otfrom08:10:52

as someone who sticks w/emacs all the time. How easy is it to move from IntelliJ/VSCode/Atom+Chlorine?

otfrom08:10:04

is there a lot of relearning or is it pretty easy to swtich

otfrom08:10:20

I find myself pretty frustrated when I've tried switching over to other tools

genRaiy08:10:52

I was gonna go with happy wet ness day but it's a friday, still wet though ... good morning

RAMart08:10:12

@otfrom I do the Clojure trainings here and for the courses I stick to the tools used by the attendees so I can answer questions. I used IntelliJ, VS Code and Atom (for Windows). Although it‘s getting better, I‘m always super happy when returning back to my Emacs (macOS). In my opinion it‘s just easy to switch if you use basic operations.

slipset08:10:05

@otfrom Intellij has decent emacs bindings these days, albeit slightly different from Emacs. Same goes for VS/Calva.

plexus09:10:15

yeah so I recommeded she starts with getting WSL set up, and then get the latest OpenJDK, and follow the linux instructions for Clojure CLI. She's used IntelliJ and VS Code in the past, so we'll probably go with Cursive or Calva

slipset09:10:50

The one thing I find indispensable in Cursive is find-usages . I know Cider has a version of that, it's just that Ciders version only checks within the loaded ns's whereas Cursive searches your whole project.

ordnungswidrig10:10:34

It’s CMD-. for me in cider and it depends (like many lisp environments) from having the NS to be searched to be loaded. One of the advantages of Intellij IDEA’s “offline” code analysis. Btw. inf-clojure for emacs, which is ways simpler thatn cider, also supports jumping to a var’s source.

slipset10:10:33

So does Cider

slipset10:10:18

But my thing is finding all usages, not jump to definition which in Cider is > M-. runs the command cider-find-var (found in cider-mode-map), which > is an autoloaded interactive compiled Lisp function in > ‘cider-find.el’. > > It is bound to M-., <menu-bar> <CIDER Interactions> <Find (jump to)> > <Find definition>. > > (cider-find-var &optional ARG VAR LINE)

ordnungswidrig11:10:09

Oh, sorry, I read that wrong 🙈

plexus09:10:09

I guess I use Spacemacs' "search project" for that. It's just a textual search but it works well.

pez10:10:50

@otfrom: is your question how easy it is to switch to emacs from those other tools? If so, my experience is that it is quite hard. I consider myself a quick and eager learner, but I'm also at an age where things I learn don't stick as long as they used to. So I could get up to speed using emacs reasonably quickly, but notice that today when I pick it up it is a bit like that first experience: ”OK, so how do I do anything with this?”

pez10:10:35

I'd say it is a more lot of relearning than it is switching between other more modern editors which have more paradigms in common with each other.

otfrom10:10:14

@pez I think I'd be going the other way around. I've got 20+ yrs of using emacs and want to try out other editors (to steal their ideas apart from anything) and find I just flail around in them and that they are difficult to set up and use.

pez10:10:48

I've seen quite a lot of struggle from Emacs users trying out VS Code. With Calva I've tried to make it reasonably familiar to CIDER users, but it only takes you so far. If you do pick Calva up, you are welcome to vent frustration and ask for help in the #calva channel. 😃

otfrom11:10:26

I reallise that my problem with other tools is my problem, not the tools 😄

otfrom11:10:48

it is what I get for using a pre-CUA editor

orestis11:10:59

I gave up and went back to 10 years of Vim muscle memory 🙂

👍 3
otfrom11:10:04

tho my general frustration w/IDEs is that I can't see enough of what I want to see which is other bits of code. If I could find another editor that allowed me to do this I might consider switching.

otfrom11:10:39

@orestis nothing wrong with vim at all. I just got differently damaged to start with. vim at least allows the above as well ^^

pez11:10:42

Whether VS Code could be configured like that is certainly a question you can ask in #calva. My guess is you can't get all the way, but I've seen quite bare bone chrome setups.

otfrom11:10:44

@pez interesting

otfrom11:10:16

I think the above type of layout has been my biggest barrier in using IDEs in general

otfrom11:10:57

using new funky destructuring things. Reasonably happy with how it has separated getting things out of a map with putting them in a vector in the right order

otfrom11:10:32

I'm leaving in the :as as documentation for me, but I'm not sure if there is a better way to do it than that

pez11:10:33

You can prefix the :as symbol with an underscore to prevent clj-kondo from flagging it.

otfrom11:10:45

interesting....

otfrom11:10:55

kondo is what I'm trying to please here

borkdude11:10:02

There is an issue in progress for this

borkdude11:10:27

PR: https://github.com/borkdude/clj-kondo/pull/1025 But tests are failing, so if you have time to help dharrigan :)

borkdude11:10:42

Else I'll take a look this weekend

pez11:10:49

I think _new is a better way to do it, because it also tells yourself that it is not used. 😃

otfrom11:10:11

that is an advantage

borkdude11:10:12

@pez Weren't you the same person asking exactly for what 1025 implements? now I'm puzzled

pez11:10:41

Haha, it wouldn’t surprise me if I was. I did say that I am of age above, didn’t I?

borkdude11:10:51

this is only like one week ago - ok, two

pez11:10:13

Haha, yeah, I am not that old. That is an impersonator.

borkdude11:10:27

who is @expez on github then

pez11:10:44

I am just @pez on github. ¯\(ツ)

borkdude12:10:08

Oh right, I'm mixing things up. I think it's a colleague of @slipset

pez12:10:21

I would never express myself like this, btw: > but I don’t want to refactor a rather large production app to conform to the worldview of the tooling du jour

borkdude12:10:23

apparently pez-something is popular in Scandinavia

dharrigan12:10:47

I dislike putting a special marker such as _ in front. It feels out-of-place and reminds me terribly of class level global variables.

pez12:10:36

I want the help from clj-kondo to tell me if I am not using variables. I might stop using them and such.

slipset12:10:38

@borkdude you’re thinking about expez :)

slipset12:10:02

expez is my colleague.

borkdude12:10:12

I figured :)

borkdude12:10:16

@slipset Well, you can tell your colleague that the tooling du jour now has granted his wish, credits to dharrigan for initiating the PR

🎉 9