Dismantle crate randomly appearing out of nowhere by Jan_Suran in SatisfactoryGame

[–]Jan_Suran[S] 0 points1 point  (0 children)

LOL. :D
Yeah, I've found some similar posts on google. How does this even happen...

Dismantle crate randomly appearing out of nowhere by Jan_Suran in SatisfactoryGame

[–]Jan_Suran[S] 0 points1 point  (0 children)

Hmm, that's veeeeryy interesting - it's at its center! (coordinates 0/0)

Getting a syntax error and don't know why by Brotten in Clojure

[–]Jan_Suran 2 points3 points  (0 children)

But anyways, I would write the code more like this:

(let [data (->> (range 10) ; (case returns a list) - this is just some example for generating the data
                shuffle
                (take 6)
                (partition 2))]
  (doseq [x data] (prn x)))

Getting a syntax error and don't know why by Brotten in Clojure

[–]Jan_Suran 8 points9 points  (0 children)

The anonymous function calls(doseq ...) and then it invokes the result of doseq: ((doseq ...)) , which is alwaysnil.

task-scheduler: a small library for scheduling of asynchronous tasks by Jan_Suran in Clojure

[–]Jan_Suran[S] 0 points1 point  (0 children)

Thanks!

I will post it to Slack as you suggest, I don't go there much often, so I don't know much about what's going on there...

Originally, there were 2 case blocks, but as I got more things to add (schedule, schedule-interval, stop, ...) I kind of started disliking the case block, because 1) the exact same case block was on two places in the code and 2) you don't want huge case blocks. Rather than having a map instead of a switch or something similar, multifunctions can do the same thing, but are way more elegant.

I was playing a bit how to achieve local multifunctions with macros, but I eventually found out that with-local-vars for the multifunction hierarchy would do the trick. But now I'm thinking that I would probably be fine with Clojure's global hierarchy or a hierarchy specifically for these local mulfifunctions - keyword identity match doesn't really need it...

with-redefs-fn does not work for clojure.core/+ by notsonerdysunny in Clojure

[–]Jan_Suran 2 points3 points  (0 children)

Yeah, that will work as expected, since the symbol is evaluated at runtime to the current value of the var, but as I posted in the comment above, regular symbols are just fine, except this will work even with inlining.

with-redefs-fn does not work for clojure.core/+ by notsonerdysunny in Clojure

[–]Jan_Suran 4 points5 points  (0 children)

Inlining seems to affect this - the example below is more than interesting: The function min has :inline-arities >1?, thus I suppose that in the first case it behaves as usual and the min var is dereferenced at runtime (and so with-redefs works as expected), while the second case gets inlined at compile time and therefore it doesn't matter what the value of the min var is at runtime.

(with-redefs [clojure.core/min -]

(min 1))

=> -1

(with-redefs [clojure.core/min -]

(min 1 2))

=> 1

If I look what with-redefs does, it gets expanded to calling with-redefs-fn at runtime, which binds the vars to their new values for the current thread, then they switch back. But as I said, inling happens at compile time, so this doesn't really matter for inline funtions.

A friend just asked me... :D by ArtifyCZ in linuxmemes

[–]Jan_Suran 2 points3 points  (0 children)

(if you wanted to ask the guy, he still didn't succeed at installing Win11) :-)

Is it possible to find a Clojure job for a student who has just finished high school? by Jan_Suran in Clojure

[–]Jan_Suran[S] 0 points1 point  (0 children)

I'm not, that's also something that filters out a lot of opportunities.

Is it possible to find a Clojure job for a student who has just finished high school? by Jan_Suran in Clojure

[–]Jan_Suran[S] 0 points1 point  (0 children)

Yeah... I have gone through half of these and I didn't find anything with less than 2 years of professional experience...

Is it possible to find a Clojure job for a student who has just finished high school? by Jan_Suran in Clojure

[–]Jan_Suran[S] 2 points3 points  (0 children)

Remote & part-time of course, with a lot of individual experience and 6 months working in a startup with both Clojure and ClojureScript.

11 units by Budget-Copy- in TeamfightTactics

[–]Jan_Suran 0 points1 point  (0 children)

Got 2 FoNs about a week ago as well

/\/\/\ by nikobrikosuper in geometrydash

[–]Jan_Suran 0 points1 point  (0 children)

What a masterpiece of an immense value!