Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a Clojure REPL to an existing .NET application?

How do I add an interactive Clojure REPL to an existing .NET application so I can use it as a live debugging aid? (Ideally this would be a C# REPL, but those are someway off (maybe .NET 5.0?) the last I heard: http://channel9.msdn.com/blogs/pdc2008/tl16)

I know there is the Clojure-CLR project on GitHub, but I wonder if someone has already come up with a guide or simple library for integrating a Clojure-CLR REPL into an existing application?

like image 408
pauldoo Avatar asked Feb 04 '11 12:02

pauldoo


2 Answers

I have no idea how different Clojure CLR is from regular Clojure, so this may not be helpful, but you should take a look at the implementations of these REPLs:

  • Enclojure (used in Netbeans)
  • Swank Clojure (used with emacs/slime)
  • Vimclojure and slimv (used with Vim)

I integrated the Enclojure REPL into the Redcar Editor pretty easily, so this might be an option for you if you port Enclojure to Clojure CLR? The code concerning the Enclojure REPL is pretty concise, so I don't think it would be a huge effort.

If you aren't looking for anything fancy, you can always roll your own REPL using the load-string function.

like image 160
dbyrne Avatar answered Oct 05 '22 04:10

dbyrne


If I understand your question correctly, you would like a C# REPL, but failing that you're looking for any kind of .NET-based REPL, and Clojure seems like a possibility since it already has a REPL, and there's a .NET port of Clojure.

If so, you might consider integrating the F# REPL, F# Interactive. For one, it's already been integrated into the open-source MonoDevelop IDE, so there's source code available to reference.

like image 25
Joel Mueller Avatar answered Oct 05 '22 04:10

Joel Mueller