cursive

Issues at: https://git.io/cursive-issues
salam 2020-09-25T03:57:01.020Z

these sound like pretty good milestones that you can quickly put into a simple roadmap.MD and publish somewhere on the Cursive’s GitHub repository or its official website. i’m sure a lot of people (including myself) are interested in this kind of stuff.

reefersleep 2020-09-25T06:56:07.020600Z

@cfleming My macro is like this:

(defmacro ->until [predicate-fn x & forms]
  (let [result (eval x)]
    (if (predicate-fn result)
      result
      (if forms
        (let [form     (first forms)
              threaded (if (seq? form)
                         (list `-> result form)
                         (list form result))]
          `(->until ~predicate-fn ~threaded ~@(next forms)))
        result))))
And can be used like this:
(->until :errors {}
         ((fn [x]
            (prn "hej!")
            (merge x {:dog "fido"})))
         (assoc :errors [])
         (assoc :wow :nej))
"hej!"
=> {:dog "fido", :errors []}

Jim Newton 2020-09-25T06:59:52.020800Z

So anyone using my library, but not my project, will get incorrect indentation for the macro calls? Is there a plan/desire to fix this? Or has it been discussed already and rejected.

Jim Newton 2020-09-25T07:00:45.021Z

BTW, extending the syntax to say "Indent A like B" would be really great, and probably easy to implement. That's what I did years ago when I customized slime to another lisp language.

Jim Newton 2020-09-25T07:02:22.021200Z

BTW(2) is there some desire to have a mutually understandable indentation specification syntax for clojure which all IDEs could choose to implement? In particular something where the macro designer can annotate on the macro definition, which will be delivered therefore with the macro to whoever uses it?

Jim Newton 2020-09-25T07:03:50.021400Z

Clearly the person who delivers a macro in a library would like to make it easy for everyone to use his macro, regardless of the editor his customers choose. right?

imre 2020-09-25T09:37:49.021900Z

Hmm I wasn't aware of that feature in idea, need to have a look at it

imre 2020-09-25T09:38:00.022100Z

Sounds rather useful

imre 2020-09-25T09:39:00.022300Z

Thanks for the updates, the voting panel would be super actually

reefersleep 2020-09-25T09:39:16.022500Z

As for your BTW(2), this goes beyond macros 🙂 It’d be amazing for there to be a cross-editor indentation ruleset.

1
imre 2020-09-25T09:40:56.022900Z

Yep that would be most welcome. I don't see any chance of it being clojure-official though, more like an agreement between tool developers

imre 2020-09-25T09:41:43.023200Z

Same for programmatic macro descriptions to help static analysis

1☝️
cmdrdats 2020-09-25T10:56:56.024800Z

hi! my cursive started printing the form in the REPL when I use "Send top form to REPL" - which kinda wrecks the history (particularly since I push defn with shortcut, then hit 'up' to replay my last form quite often)

cmdrdats 2020-09-25T10:57:09.025300Z

I don't know if that's just a setting I accidentally changed, but I can't find it

cmdrdats 2020-09-25T10:58:16.025500Z

ah, found it

cmdrdats 2020-09-25T10:59:10.026400Z

Languages & Frameworks -> Clojure -> uncheck "Add forms sent from editor to REPL history" - in case anyone else wants to know xD

1🎉
2020-09-25T11:11:17.028500Z

There's also Cmd-Up (or Ctrl-Up on PC) to scroll an entire form at a time in the REPL history. For example, if you have "Add to REPL history" checked, and you send a 5-line form to the REPL, you can use Cmd-Up to get to the previous REPL command instead of having to hit Up 5 times.

2020-09-25T13:17:33.028900Z

@cfleming There might be some changes on that front based on Rider, but I can completely understand not wanting to go down that rabbithole =)...

reefersleep 2020-09-25T13:21:06.029200Z

It wasn’t the font, it seems. Gotta try updating my OS/IntelliJ/Cursive next.

Felipe de Morais 2020-09-25T21:16:38.030100Z

Great tip! I was not aware of this feature on IntelliJ but it works pretty well in my workflow! Thanks, @cfleming

cfleming 2020-09-25T23:19:01.030400Z

Yes, supporting Rider would be basically a total rewrite of Cursive, since it works in a very different way to other IntelliJ plugins (more like a LSP).

1