Fork me on GitHub

I know about . It has not reached a level for 'practical' use for met yet. Has anyone here managed to script IntelliJ (or any other IDE) in Clojure like one scripts Emacs in Elisp ? [I'm basically looking for an IDE that I can dynamically reprogram in Clojure.]


Basically that is how LightTable was done (with ClojureScript). I believe the same is true for ProtoRepl (which should have more support these days)


You can also look at Nightcode and Nightlight


But the truth is, you won't find anything nearly as good as Emacs. I'd say for that it is a better investment to just use Emacs and learn some Emacs Lisp. Which is a lot easier once you know Clojure.


Curious to know if there is a standard workflow to navigate Protocol implementations. Particularly jump from a protocol method call to it's implementation. Example

(ns dirigent.protocols)

(defprotocol Trippable
  (tripped? [this])
  (run-body [this body-fn])
  (reset-trip [this]))

(ns dirigent.records.counter)

(defrecord CounterCB
    [circuit-breaker-name counter-state failure-pred threshold timeout]
  (tripped? [this]
  (run-body [this body-fn]
    (ctl/info "Running the body and counting errorr if possible"))
  (reset-trip [this]
    (ctl/info "Resetting the trip")))

(ns dirigent.records.sliding-window)

(defrecord SlidingWindowCB
    [circuit-breaker-name counter-state failure-pred threshold timeout]
  (tripped? [this]
  (run-body [this body-fn]
    (ctl/info "Running the body and counting errorr if possible"))
  (reset-trip [this]
    (ctl/info "Resetting the trip")))

(ns dirigent.core
  (:require [dirigent.protocols :refer [run-body]]))

(defn run-main
  ;; cb-record can either be CounterCB or SlidingWindowCB
  (run-body cb-record))
I would like to navigate from run-body in dirigent.core/run-main to implementations dirigent.records.sliding-window or dirigent.records.counter I came across this issue on cider I have rough solution which works by changing cider-nrepl info middleware (Edited) (Original) Wanted to know if, 1. Is this the right approach of structuring code so that navigation becomes easier? 2. Is there a better approach to solve this?


I would post this in the issue you mention and potentially open a PR against cider-nrepl, where that piece of code lives. Putting it there is a good thing because Slack will swallow this message soon


Please tell me what is your favorite code formatting library? Maybe you just trust your IDE's formatting?


Emacs does the right job, but otherwise cljfmt is the only one I know


do you think it is Emacs by it self, or the job is done by Paredit ar Cider?


I think mostly Emacs + Clojure mode, cider might add a bit of extra smartness around macros


but paredit doesn't really affect formatting imho, it simply helps you working with sexpressions

šŸ‘ 4

So I'm thinking about throwing a repo together for this prototype predicate dispatch thing I put together here: Anybody got a good idea for a library name? poly? polypred? predicate-dispatch? And what should be the name of the main defmethod-like macro? Currently it's defpoly but defpd might be clear enough?


I like predicate-dispatch. I don't really have any good names for the macro since defpoly immediately raises the "poly-what?" question and I think defpd is just a bit too terse


Is "poly" from "polymorphic" not the closest semantic to what we're talking about? "multi" is another obvious one, but there's some semantic overlap there with "multi"methods


Maybe defpatch, in the spirit of "dispatch," but sorta like you're "patching" the definition šŸ™‚


I just installed Java/Leiningen/InteliJ on my Mac. I am getting strange error messages when I include libraries. Is there some way to verify if the install went ok? The rep works, but I don't know why this error comes up. When I worked on Linux with the same code, all was fine... Many thanks!!


@davidpty looks related to Does it happen with say Java 8?


I would love love love to see a page that shows me how to dissect an atom like a surgeon with code examples


I have to constantly re-reference basic material with regards to atoms and data storage. it's a shocker


most of the things i want to do are very basic: add a map to an atom, search an atom for a map with a matching :username "value"...


An atom only holds a single value - usually that value is a hash-map, but that's not always the case.


an atom is a pointer to a value that can be be atomically compared and swapped for another value


pointer dereference and atomic cas are the only two operations that exist for it, anything else is some operation on a value pointed to by the atom, not an operation on atoms


you can also set or remove a validator or a watch function


my point is just, an atom has those two operations only, and anything else "adding" whatever, or "searching", or whatever, have nothing to do with atoms


so if you find yourself not knowing how to do whatever with an atom, the atom is not the part that matters, in reality you just don't know how to do whatever (search for things in a map, add things to a map, etc), so should focus on basic data structure manipulation (update-in, conj, seq, contains?, assoc) and ignore/forget anything to do with atoms


Iā€™m looking for some code which would take a randomly-generated code form (from a spec or some other grammar) and then randomly break it in various ways in order to write generative tests for code using the parsed form.


Before I start bashing out the code-walking code, which is often a bit of a mess of edge cases, I thought Iā€™d check if such a thing existed.


Does anyone know of anything like this?


Actually, it looks like zippers would be the best way to do this.

šŸ¤ 4