Fork me on GitHub
#cursive
<
2023-12-13
>
onetom02:12:04

Clojure is not on the list of Language filters here, but Scala is: https://www.jetbrains.com/products/ I guess that has something to do with why Clojure is also missing from the The State of Developer Ecosystem 2023 analysis: https://www.jetbrains.com/lp/devecosystem-2023/ Would it be possible to nudge someone at JetBrains to consider including Clojure? Or at least explain somewhere why is it not there? Or it's actually there, just beyond the fold, where they cut off the report?

cfleming00:12:49

I can ask, but I suspect the issue is that it’s not supported by JetBrains’ own tools. Other languages that have third-party options (Elixir, OCaml) aren’t there either.

onetom01:12:34

i just looked https://www.jetbrains.com/lp/devecosystem-2023/languages/#proglang_plus_adopt today and it shows Clojure now, if I press [Show more] i do remember i pressed some [Show more] buttons yesterday too, but i might be wrong. getting old and my memory is starting to fail... 🙂

JI Lao05:12:47

Do we need to load file in repl to re-execute the latest code every time you change the code in the editor?

Bob B05:12:31

it's not generally necessary to reload an entire file - it's possible to send individual forms to the repl

JI Lao06:12:38

(defn solve [input-file]
      (let [strs (aoc/read-input input-file)]
         (->> (map #(str/split % #" ") strs)
              (map #(assoc % 1 (map parse-long (str/split (last %) #","))))
              )
        )
  )

(solve 12)

JI Lao06:12:51

Add I modified the code inside solve, then re-execute solve 12 need to reload the file, if you only execute the current form solve will be because there is no function parameter and report an error.

Bob B06:12:53

you would send the solve defn to the repl to change the definition, and then re-run the call to solve

JI Lao06:12:35

It still seems to take two steps to accomplish this, and it doesn't seem to be much of an efficiency improvement over my previous loading the file first and then executing the solver

Bob B06:12:41

the time saving sometimes comes at scale... if I've got a namespace with a bunch of functions or top-level definitions that have to calculate stuff or whatever, reloading a whole file can take a few seconds, and most of the time is re-defining things that haven't changed

JI Lao06:12:55

Ok, it's true that loading the file isn't necessary, I seem to have discovered that I can customize the command to achieve the effect I'm looking for

JI Lao06:12:29

This has automation of commands before, during, and after execution.

JI Lao06:12:43

Have you ever used this feature?

JI Lao06:12:58

What are your usage scenarios and can you define shortcuts for this command

JI Lao06:12:29

Ok, I've set it up, configured the shortcuts and it's very easy, thanks for your patience!

Bob B06:12:52

printing the return value into the file, and yes, you can define shortcuts: from <https://cursive-ide.com/userguide/1.8.2/repl.html#interaction-with-the-editor> > Once you have created the command, you can bind a key to the action in Settings→Keymap. You can find the command either searching for its name, or you can collapse the whole tree and then navigate to Main Menu→Tools→REPL→Commands.

🙌 1
❤️ 1
onetom12:12:27

u shouldn't be doing computations during the loading of a namespace, IF they are costly. put those into a (comment ...) form, so u can reload the namespace without incurring re-computation cost. then u can define a REPL Command which Re-executes your last expression. for more info, see this thread: https://clojurians.slack.com/archives/C0744GXCJ/p1656568369011719?thread_ts=1656567319.736669&amp;cid=C0744GXCJ

Ivar Refsdal21:12:28

> u shouldn't be doing computations during the loading of a namespace, IF they are costly. or use (defonce ...)

onetom01:12:51

@UGJE0MM0W i wouldn't recommend that, because that also makes the REPL workflow more rigid and confusing too, because u can't easily redefine those defonces, which u do want to redefine IF the definition of the functions AND other defed values they use changes. in other words u would need to keep in mind the data dependencies and walk those dependencies manually, while you are changing your program. iirc, jupyter notebooks have the same problem. if u re-eval some expression in the middle, u would need to re-eval subsequent expressions one by one afterwards.