Skip to content

Instantly share code, notes, and snippets.

Avatar

Colin Fleming cursive-ide

View GitHub Profile
View output.txt
Loading src/nrepl_tests/src.clj... done
(let [server (start-server :port 7888)]
(try
(test-on 7888)
(finally
(stop-server server))))
; These are responses from the CLJ version
@cursive-ide
cursive-ide / bad.bytecode.txt
Last active Jan 17, 2019
Clojure JDI problem bytecode before & after
View bad.bytecode.txt
Classfile /Users/colin/dev/cursive-2099/classes/cursive_2099/core$_main.class
Last modified 18/01/2019; size 1271 bytes
MD5 checksum f74ca1f9fccde176d30524a628eaa1ee
Compiled from "core.clj"
public final class cursive_2099.core$_main extends clojure.lang.RestFn
minor version: 0
major version: 52
flags: ACC_PUBLIC, ACC_FINAL, ACC_SUPER
Constant pool:
#1 = Utf8 cursive_2099/core$_main
View nil-pun.clj
; Before
(defn light-keys [symbol language]
(let [states (light.resolve/resolve-states (psi/containing-file symbol) language)]
(loop [current (psi/parent symbol)] ; <- infinite loop if current is nil
(if-let [state (get states current)] ; because psi/parent nil puns
(light.resolve/resolve-keys symbol state)
(if (psi/file? (psi/parent current))
(recur (first (filter psi/significant? (psi/prev-siblings current)))) ; <- first can return nil
(recur (psi/parent current)))))))
View gist:4422cfa7e21ba4104403
~/d/c/jitpack> lein deps :tree
Retrieving com/github/SquidPony/SquidLib/squidlib/-v3.0.0-b3-g386143b-39/squidlib--v3.0.0-b3-g386143b-39.pom from jitpack
Retrieving com/github/SquidPony/SquidLib/squidlib-parent/-v3.0.0-b3-g386143b-39/squidlib-parent--v3.0.0-b3-g386143b-39.pom from jitpack
Retrieving com/github/SquidPony/SquidLib/squidlib-util/-v3.0.0-b3-g386143b-39/squidlib-util--v3.0.0-b3-g386143b-39.pom from jitpack
Retrieving com/badlogicgames/gdx/gdx/1.9.2/gdx-1.9.2.pom from central
Retrieving com/badlogicgames/gdx/gdx-parent/1.9.2/gdx-parent-1.9.2.pom from central
Retrieving com/github/SquidPony/SquidLib/squidlib/-v3.0.0-b3-g386143b-39/squidlib--v3.0.0-b3-g386143b-39.jar from jitpack
Retrieving com/github/SquidPony/SquidLib/squidlib-util/-v3.0.0-b3-g386143b-39/squidlib-util--v3.0.0-b3-g386143b-39.jar from jitpack
Retrieving com/badlogicgames/gdx/gdx/1.9.2/gdx-1.9.2.jar from central
[clojure-complete "0.2.4" :exclusions [[org.clojure/clojure]]]
View gist:593ee7421e765d1b0dba
The other new feature is an interactive macroexpander. It requires a REPL to perform
the actual expansion, with the current namespace loaded into it. Start by executing
Tools->REPL->View Macro Expansion. This will select the nearest surrounding macro
form and display it in a popup window. You can move the cursor anywhere within the
form and either click the right arrow in the toolbar or use Ctrl/Cmd-right - this
will expand the nearest surrounding macro form and all forms above it up to the
top displayed form - the cursor will be left at the start of the innermost form
that was actually expanded. Give it a try, it’s less confusing than it sounds!
There are also various controls in the toolbar for various sorts of prettification -
you can show and hide metadata, tidy up referred vars and imported classes etc. This
@cursive-ide
cursive-ide / parsing.clj
Created Aug 29, 2014
Cursive parsing lib example
View parsing.clj
; Parsers are defined like this - this this for the core.typed defprotocol
(defn binder []
(vector (alt (symbol :into :bindings)
(vector (symbol :into :bindings)))))
(defn type-decl []
(all (keyword :matching :-)
(any :into :types)
(opt (alt (symbol :matching '*
:into :no-resolve)