This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-26
Channels
- # aatree (1)
- # admin-announcements (1)
- # beginners (84)
- # boot (239)
- # braid-chat (5)
- # braveandtrue (20)
- # cider (42)
- # cljsjs (4)
- # cljsrn (31)
- # clojars (18)
- # clojure (101)
- # clojure-austin (1)
- # clojure-gamedev (4)
- # clojure-madison (2)
- # clojure-poland (30)
- # clojure-russia (37)
- # clojurescript (95)
- # core-async (7)
- # cryogen (1)
- # css (3)
- # cursive (14)
- # datomic (8)
- # devcards (7)
- # dirac (2)
- # editors (2)
- # emacs (2)
- # funcool (1)
- # hoplon (15)
- # immutant (30)
- # ldnclj (37)
- # lein-figwheel (6)
- # leiningen (8)
- # luminus (5)
- # mount (1)
- # off-topic (59)
- # om (325)
- # om-next (7)
- # onyx (95)
- # parinfer (162)
- # proton (1)
- # re-frame (4)
- # reagent (23)
- # slack-help (4)
- # yada (43)
thank you for keeping up with parinfer-jvm @cfleming
a lot of that was Parinfer related
@chrisoakman yep I got the stickers! I'm only gonna give them to my students who like clojure
rationing, eh?
I don't remember where I heard this from, but you're teaching at The Iron Yard these days?
I considered teaching at their Houston chapter here, but I couldn't bring myself to teach non-clojure
@sekao: Do you teach Clojure to non-programmers, or to people with other dev experience?
Yeah they actually found it pretty hard. One problem was that they had a really hard time editing it. They couldn't remember paredit commands, and without it their parens were constantly unbalanced. Hence why I'm here :)
oh man
yeah, that's huge
I need to write about this, but I think Parinfer is a game-changer for Lisp
it totally removes the "balance parens" or "learn an extreme editing mode" part of the equation
(I think the learning curve of paredit is too steep)
I'm trying to promote the idea that Parinfer turns Lisp into an off-side rule language like Python or CoffeeScript
I should actually take PyCharm for a spin, I don’t know what editor functionality they provide around indentation.
yeah i’ll definitely let y’all know how it goes. my current class is on week 4 so i have some time before we get into clojure
sounds good; let us know if you run into anything
FYI - I'm a fan of The Iron Yard. I have spoken to every cohort here in Houston
in general I'm bullish on the idea of these coding bootcamps; hired some people out of one at my last job and taught them CLJS
they were some of my best team members
yeah it’s been a great gig. i dunno if any others are teaching clojure or other functional langs. they’ve given me a lot of leeway
I've been toying with the idea of giving a weekend clojure workshop here in Houston with Shaun
we have enough people who are interested I think
I feel like people need to dedicate some time to it; I don't think it's the sort of thing you can really learn in a few hours
Yeah, I helped out at a ClojureBridge - even with a whole day, a lot of the code they wrote was filling in the blanks in code they’d been given.
@snoe: hey good to hear from you. did you see that bryce (a.k.a. remington) is speaking at clojure/west?
@cfleming: been playing with the new release. in a repl, i did (Parinfer/parenMode "(defn hi []\n)" (int 0) (int 1) (int 0))
. the result has a text of "(defn hi []\n )”
, which is right (if indenting by one space is the intent), but it seems the cursorX is 0
. shouldn’t it be 1
so it is next to the end paren?
Yeah, cursor-dx is if you’re in paren mode and you know how much the current edit moved the cursor by.
Ok, so that actually looks right. Since the lines are 0-based, your caret should be at the start of the second line.
shouldn’t it move the cursor to be next to the end paren? i tried the same thing in parinfer.js: parinfer.parenMode("(defn hi []\n)", {cursorX: 0, cursorLine: 1})
and the result’s cursorX is 1
.
weird…i tried (Parinfer/parenMode "(defn hi []\n)" (int 0) (int 1) nil)
and the cursorX is still 0
for me.
Connecting to local nREPL server...
Clojure 1.8.0
nREPL server started on port 58111 on host 127.0.0.1 -
(import com.oakmac.parinfer.Parinfer)
=> com.oakmac.parinfer.Parinfer
(.-cursorX (Parinfer/parenMode "(defn hi []\n)" (int 0) (int 1) nil))
=> 1
I’m actually pretty new to gradle, but I can’t imagine that does anything too different.
I did the install, and then in a lein project pulled in [com.oakmac/parinfer "0.3.0”]
as a dep.
wait, (.-cursorX (Parinfer/parenMode "(defn hi []\n)" (int 0) (int 1) nil))
actually does return 1
for me. i was doing (def res (Parinfer/parenMode "(defn hi []\n)" (int 0) (int 1) nil))
and then (.-cursorX res)
, which returns 0
.
The only thing I can think of is that in the first case, type inference will give the correct type, whereas in the second it will not.
(.-cursorX (deref (def res (Parinfer/parenMode "(defn hi []\n)" (int 0) (int 1) nil))))
also returns 1
. i have no idea what that means
~/d/parinfer-test> javap -classpath ~/.m2/repository/com/oakmac/parinfer/0.3.0/parinfer-0.3.0.jar com.oakmac.parinfer.ParinferResult
Compiled from "parinfer.kt"
public final class com.oakmac.parinfer.ParinferResult {
public java.lang.String text;
public boolean success;
public java.lang.Integer cursorX;
public com.oakmac.parinfer.ParinferException error;
public java.util.ArrayList<com.oakmac.parinfer.LineDelta> changedLines;
public com.oakmac.parinfer.ParinferResult(com.oakmac.parinfer.MutableResult);
}
what is the status of success
for these calls?
I also have a completely unrelated question
I pulled the latest parinfer-jvm and ./gradlew install
is taking bloody forever
I've been on that screen for like 10 minutes
oh wow - it's moving now
haha, right as I uploaded that
now I suppose there is a different problem
I just ran it again and got the same thing
what is clojuresque
?
ok, I got things working by typing ./gradlew clean
I'm just updating the README
making sure the setup instructions work
I just know it worked after I tried the ./gradlew clean clojureTest
command
I haven't updated my system in a while; could be something left over from whatever I was doing previously with Kotlin
I just want to make sure the README is bulletproof
it's painful when projects don't have clear setup instructions
I actually have to head off. I have no idea what might be causing that problem, sorry - I’ll try to look at it over the weekend.
no worries
pretty sure this crew are the only people using Parinfer at the moment anyhow 😉
Hehe, true enough - it seems to be working pretty well for me, although I have a bunch of niceties to add around the edges.
sweet
I'm sure people will be glad to hear that and play around with it
found a workaround...wrapping the calls in functions that return the results in a map seems to avoid the weird behavior
strange
wonder if it has anything to do with Kotlin
I thought it was something to do with the fact that the field was primitive, but in fact it’s not, it’s an Integer object.
I added a toString() to the result object, just to confirm that the actual result itself is different - it is:
Connecting to local nREPL server...
Clojure 1.6.0
nREPL server started on port 60022 on host 127.0.0.1 -
(import com.oakmac.parinfer.Parinfer)
=> com.oakmac.parinfer.Parinfer
(def res (Parinfer/parenMode "(defn hi []\n)" (int 0) (int 1) nil))
=> #'user/res
res
=> #<ParinferResult ParinferResult(text='(defn hi []
)', cursorX=0, success=true)>
(Parinfer/parenMode "(defn hi []\n)" (int 0) (int 1) nil)
=> #<ParinferResult ParinferResult(text='(defn hi []
)', cursorX=1, success=true)>
I have literally zero idea why the context in which the function is invoked should affect the result.
@cfleming: Have you tried setting up parinfer as nrepl middleware? That would really enable parinfer for emacs users quite well (and anything that can connect to the nrepl really..)
@dominicm: No, I haven’t. Paredit is really a client-side thing since it works on the source code, not during evaluation.
@cfleming I agree that really it's client side. But I'm trying to come up with a way to have one parinfer implementation to rule them all
@dominicm: oh man, was it an oversight to port parinfer to kotlin instead of using nashorn?
@snoe idk what you mean by pooling. is that jvm specific?
so in order to run nashorn you need to create an engine, but the engine takes 2-5s to start IME. so you'd usually start a bunch put them in a pool, and take them out and refill as needed
ha okay. thanks
wonder if syncing features across ports is easier than pooling then
prolly not
@shaunlebron: I mean.. maybe? 😛 Might have saved you some time, and I think consistency across implementations is important.
looks like i’ve mostly got parinfer into nightcode. am i correct that one-space indentation is the intended behavior? it’s not how i’ve normally indented in the past but that seems to be the behavior in both parinfer.js and parinfer-jvm
@snoe: i mean paren mode. the output string of ”(defn hi []\n)”
is ”(defn hi []\n )”
. should i adjust it after the fact to insert two spaces instead of one?
i could look into adjusting its output but i thought the point of paren mode was to figure out indentation for me so indent mode can be used afterwards
so I think indent mode handles the pressing enter issue, my plugin doesn't need to indent there