Home Download Buy Blog Forum Support

Clojure evaluation

Clojure evaluation

Postby Andrew Kondratovich on Sat Oct 08, 2011 11:36 am

Hi.

I like to write code on Clojure.
But after emacs it's hard without slime and expression evaluation.

So, I wrote a little socket-based REPL and Sublime plugin for it.

First, download and build https://github.com/kondratovich/socket-repl.
Second, download https://github.com/kondratovich/evaluate. Instructions in README.

Now, you can run socket-repl and evaluate selected clojure expressions. Results will be in console.

Any suggestions ? You are welcome.
Andrew Kondratovich
 
Posts: 1
Joined: Sat Oct 08, 2011 11:24 am

Re: Clojure evaluation

Postby grayrest on Fri Oct 14, 2011 1:04 pm

sublimator wrote:Any book recommendations?
Practical Clojure and Joy of Clojure. The former is more of an intro while the latter is an intermediate book.
grayrest
 
Posts: 12
Joined: Thu Sep 29, 2011 5:03 pm

Re: Clojure evaluation

Postby wuub on Fri Oct 14, 2011 4:05 pm

Andrew Kondratovich wrote:Any suggestions ?


If you wish, you can try using SublimeREPL with Clojure.
http://code.wuub.net/sublimerepl/

viewtopic.php?f=5&t=2964

It seems to be working rather well, when compared to the PITA that Ruby's IRB is.
SublimeREPL via Package Control & SublimePTY dev/pre-alpha. Donations are appreciated, but not required :) Twitter: @wuub
wuub
 
Posts: 218
Joined: Wed Aug 10, 2011 8:16 am
Location: Poland

Re: Clojure evaluation

Postby vemv on Tue Jan 24, 2012 9:15 am

Hey, it works! neat plugin, thank you Andrew. And both the .clj and .py scripts are so cleanly written - I like how they just apply functions to data - as opposed to other approaches.

I see two ways in which this program could be improved. First, I don't find all comfortable having to select the expressions prior to evaluating them. I'd just keep reading the input until the first parens/bracket/... is matched.

And second - I'd show the output in the console that is running the REPL server's rather than in Sublime's, as a) it's more general-purpose -as the same program could serve other editors- and b) I don't like to see Sublime's and REPL's output all mixed.

I reckon that actually it'd be fun and motivating to implement them myself but - perhaps you'd had no problem in adding those features?

Cheers - Victor.
vemv
 
Posts: 1
Joined: Tue Jan 24, 2012 9:00 am

Re: Clojure evaluation

Postby sandover on Tue Jan 24, 2012 7:51 pm

vemv wrote:First, I don't find all comfortable having to select the expressions prior to evaluating them. I'd just keep reading the input until the first parens/bracket/... is matched.


Agreed! This would be a great addition.
sandover
 
Posts: 12
Joined: Tue Aug 23, 2011 5:17 pm

Re: Clojure evaluation

Postby sandover on Wed Jan 25, 2012 6:19 pm

sandover wrote:
vemv wrote:First, I don't find all comfortable having to select the expressions prior to evaluating them. I'd just keep reading the input until the first parens/bracket/... is matched.


Agreed! This would be a great addition.


Actually, I think what Clooj does is even simpler; it looks in both directions for a blank line, and evaluates everything between blank lines. So if you have a block of (def ) expressions, for example, you can evaluate them all with one stroke. But if you're working in a function, it usually has blank lines before and after, so you grab and evaluate just the function.
sandover
 
Posts: 12
Joined: Tue Aug 23, 2011 5:17 pm

Re: Clojure evaluation

Postby wuub on Fri Jan 27, 2012 2:26 pm

I just pushed a change to SublimeREPL adding better block transfer for Clojure. Just set your cursor after the last bracket of the function you want evaluated and press F2, b

Multiple cursors are supporter. Use Shift+F2, B to experiment.
SublimeREPL via Package Control & SublimePTY dev/pre-alpha. Donations are appreciated, but not required :) Twitter: @wuub
wuub
 
Posts: 218
Joined: Wed Aug 10, 2011 8:16 am
Location: Poland


Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 12 guests