Fork me on GitHub

@sogaiu very possible, I didn't do a fresh install of Catalina though, so fish is still my standard shell.


Env vars on Mac OS X are just a huge mess. As alex said your "bash" env is completely ignored when apps are run


I face this often when dealing with JAVA_HOME


And things have changed a lot during the past releases of Mac OS X.


I now use jenv exclusively to maintain JAVA_HOME properly; for other stuff I don't care as much but in case you need it you have to mess with .plist files (hard to say which one is the best)


It’s strange though because it works on my colleagues machine with Catalina and it used to work for me before catalina…


Just curious, is there a way to make e.g. clojure.pprint/pprint use the Cursive pretty-printer?


@flowthing There isn’t, but I’m planning on allowing pretty printing via Cursive from the REPL via an injected function, something like cursive.repl/pprint or something.

❤️ 4

Cool, thanks!


I’d also like to support diffing data structures in the Cursive GUI and other nice things.


That would be fantastic. :thumbsup:


i would use diffing all the time, but nowadays even the idea diff does not work


for now i've resorted to using a bunch of different libraries and a few util functions to concisely inspect intermediary results while building data pipelines and testing them against production data with tens or hundreds of thousand elements.


These are the most useful libs:

(ns repl
    [gini.utils :refer :all]

    [clojure.set :as set]
    [ :as data]
    [clojure.string :as str]
    [debux.core :refer :all]
    [clansi :refer :all]
    [puget.printer :as pug :refer [cprint]]
    [clojure.pprint :as pp :refer [print-table]]
    [zprint.core :as z]
    [lambdaisland.deep-diff :as ddiff]
    [semantic-csv.core :as scsv])
  (:import [lambdaisland.deep_diff.diff Mismatch]))

👍 4

this is a deep-diff printer with color customisations which make it readable in the cursive repl on a light theme:

(defn print-ddiff
  ([ddiff] (print-ddiff 80 ddiff))
  ([width ddiff]
   (->> {:width width}
        (ddiff/pretty-print ddiff)
          {:color-scheme {:number [:blue]
                          :string [:underline :black]}}))))


use as

    {:a 132 :B {:c "asd" x: 'y}}
    {:a 999 :bb {x: 'z} :extra "data"}))


The other thing I use often is this little sequence sampler fn:

(defn ?? [n] (juxt count (partial take n)))
(def ? (?? 4))
and in combination with for example:
(->> [big-seq-1 big-seq-2]
   (map set)
   (apply data/diff)
   (take 2) ; if we don't care about the common elements
   (map ?))
it's very useful, until cursive's pretty printer won't limit the dimensions of the printed expression evaluation results


(the ansi escapes are garbled sometimes though, but it's usable enough, so i haven't bothered with finding a minimal repro case yet)


Also, I got to thinking a while back about whether it would be possible tap> values and have them appear in the Cursive GUI. Something like a built-in clojure.inspector (or mini-REBL).


Yes, once I have the REPL-to-IDE channel established it should allow all sorts of nice things along those lines, similar to a REBL in the Cursive GUI.


I don't want to take up much of your time with this, but I'm kinda curious about the approach you've considered for the REPL-to-IDE channel. I toyed with the idea of creating something like that myself, but I wasn't sure how to accomplish just that. My first thought was establishing a pREPL server at the IDE end and sending data that way, but I'm not sure whether that would be a viable option.


What I’m planning is for REPL protocols using framing (nREPL, and what Cursive’s new socket REPL uses, would work for prepl too), I can send messages back as part of an evaluation.


So the commands like pprint and diff will just send messages back to the IDE over the standard REPL channel. The challenge is that the mechanism for doing that is REPL specific.


prepl already has something like this - the REPL client will receive messages from tap>


But that’s hard-coded in the prepl impl.


Gotcha, makes sense. :thumbsup:


Awesome! Very glad to hear it. Something like that would be really helpful for debugging, especially combined with the data structure diffing capability you mentioned.


Hi! Can I start a lumo repl from Cursive? or just connect to a started one?


I works 🎉 thanks!


For those users who have reported problems with dependency completion (@tap, @dazld and others), it does appear to be extremely funky in IntelliJ 2019.2 and 2019.3. I must have tried to reproduce on 2019.1, my apologies. I’m going to contact JetBrains to figure out what’s going on.

👍 16

Updated to eap7. Do I have to do anything to provide useful data to the debug logging you added?


No thanks - I’ve actually figured out the problem (or at least, reproduced and diagnosed it):


So now I’m just waiting on JetBrains to get back to me.


eap7 contains no changes for this in the end. Assuming they can help me out hopefully eap8 will contain fixes.