I've just published Chlorine v0.1.7 (please notice the jump from 0.1.6 - I've just discovered that if I unpublished a package, I can't use the same version again) I've tested this release on a MacOSX that had the bug, and seems that it works fine!
@lilactown the mac I've tested is 10.13, and yours is more recent. I hope it works, if it does, please reply here ok, so I'm sure the problem was fixed? Also, thanks for the report and the patience. I'll probably blog about this issue too, it seems kinda cryptic to not talk about š
no worries :D Iām an Emacs user by day but was helping a new coworker get started with Clojure. he promptly went on vacation so no one was blocked! hahahaha
I can successfully connect to a socket REPL and evaluate a selected form from a file!
quick question for a noob: is there a way for me to execute a form by typing in the REPL itself? I currently can't seem to do that
(another reason I like Chlorine: you can't type into the REPL! Put scratch code in a (comment ...)
and eval it from there)
Rich Comment Forms š
Stu pretty much called typed directly into the REPL an antipattern in one of his REPL-Driven Development talks.
ah OK. it was a bit surprising that I could type into the REPL but not evaluate
I mainly work in an Emacs buffer with comments like you said, but when I'm teaching it can help to level set
I think maybe Atom just doesn't stop you from typing into the Console pane?
since most people are used to typing into a terminal window / buffer and evaluating things (JS, shell, etc.), so you can show that you're connected. then move on to showing how to evaluate forms inline
I think teaching people to eval from a file -- either actual source code or (comment ...)
forms -- is probably better from the get-go. I.E., undoing their former "bad practice" and showing them just how different the Clojure REPL experience is/can be?
I think it takes a lot for people to stop typing into the REPL if that's how they started out... That said, if I want to just quickly try something outside of any project, I just fire up clj
in Terminal or PowerShell and type into it...
I think there may be a way to avoid typing in the Console pane. In fact, there's really no deeper reason why you can't evaluate things by typing on the REPL itself other than "I didn't implement it yet"
Never imagined that this "bug" would be a feature š
Also, great that it worked! As I have no Mac to test the release builds, I could never imagine that the behaviour of Atom would be so... strange distinct š
This will be a tricky merge from master for me so I won't be testing it until next week (my develop branch has a bunch of changes that will conflict). I need to decide whether to just blow away my changes at this point... but first I need to remind myself exactly what those changes are š
I added inspect-selection and eval-and-insert-as-comment. Maybe other commands. I don't use either of those very much tho'...
So just to summarize what I did: I moved activate
away from core.cljs
, and transformed it on a simple map that maps keys to functions. Then, I just expose it to JS side and add then normally.
Also, I'm testing a better way to add custom commands. Will add a documentation for it too, so maybe these local changes could be simplified š
From my p.o.v. the two hooks I'd like to tie into are 1) the ability to wrap source code prior to evaluation (that's how the inspect variants of eval work) and 2) the ability to provide a custom result handler (print via ink, print to console, alert popup, insert code -- that's how my insert-as-comment variants work).
Of course, I'd want to be able to write those in ClojureScript rather than JS so I don't know how that could be done -- providing JS files to be loaded would be much easier from your p.o.v. š
Yes, currently it needs to be done on JS. For example, this is the hook I have on my init script to pretty-print prismatic schemas on the editor.
I think to be able to write on CLJS we could use the "bootstrap" target that shadow-cljs now supports š
That's actually not too bad... I might try just installing 0.1.7 and then putting my inspect selection command in that way, as an experiment. I'd certainly rather run with the "stock" Chlorine so it's easier for me to customize across all my machines...
protoRepl.EditorUtils
?
Ahh, I still have proto-repl installed, it seems! Just edited the snippet, it's just a simple helper (I'll also edit my own init script too)
Also, you don't need to instal 0.1.7, I think I've added this feature on 0.1.4 or something and not changed since. At the beginning was just to debug some errors but I found it really useful so I left it there š