7

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?

pauldoo
  • 18,087
  • 20
  • 94
  • 116

3 Answers3

2

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:

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.

Matt Briggs
  • 41,224
  • 16
  • 95
  • 126
dbyrne
  • 59,111
  • 13
  • 86
  • 103
  • this is a truely horrible answer. he doesn't want a clojure repl for clojure, he wants a clojure repl to interop with a platform that is lacking one. – Matt Briggs Feb 04 '11 at 19:05
  • @Matt with a normal clojure repl you can interact with the rest of the JVM. I would assume you can interact with the CLR the same way with Clojure-CLR? What am I misunderstanding? – dbyrne Feb 04 '11 at 19:06
  • because all of those involve serious hacks (like Nailgun that vimclojure uses), or are highly dependent on the JVM (like anything to do with netbeans) – Matt Briggs Feb 04 '11 at 19:24
  • The enclojure repl really has nothing to do with netbeans. The server is 250 lines of clojure, and 50 lines of java. Hardly something I would consider out of the question of porting? Unless the capabilities of Clojure-CLR are so different as to make this impractical? – dbyrne Feb 04 '11 at 19:32
  • Thats true. I apologize for the agressiveness of the response. I thought you didn't really understand the question, and were just linking to random repl implementations that would in no way help him, since they are all based on the jvm. removing the downvote (need to edit first so my vote will unlock) – Matt Briggs Feb 04 '11 at 22:13
2

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.

Joel Mueller
  • 28,324
  • 9
  • 63
  • 88
  • Interesting, and there is a post here that may also be helpful: http://stackoverflow.com/questions/1563024/embedding-f-interactive – pauldoo Feb 15 '11 at 16:15
2

My eventual solution was to adopt IronPython. As Joel correctly identified I was not particularly tied to Clojure (my question was ill-posed), and any language supporting interactive development would do.

Looking for eval function in any .NET language

Community
  • 1
  • 1
pauldoo
  • 18,087
  • 20
  • 94
  • 116