<< Back to previous view

[CLJCLR-11] Simplify integration of Clojure code with existing .NET code Created: 03/Mar/13  Updated: 04/Oct/14  Resolved: 04/Oct/14

Status: Resolved
Project: ClojureCLR
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Aaron Craelius Assignee: David Miller
Resolution: Completed Votes: 1
Labels: None

Attachments: Text File clojure-hosting2.patch     Text File clojure-hosting.patch    
Patch: Code


It would be nice to have a nice high-level wrapper class for key Clojure integration functions. In IronPython for example, there is a IronPython.Hosting.Python class. For ClojureCLR, I created the attached clojure.lang.Hosting.Clojure class which provides three simple functions Require, GetVar, and AddNamespaceLoadMapping (for integrating .clj files into .NET assemblies as embedded resources). This class or one like it is a simple suggestion to make integration with existing code as painless as possible.

Sample usage:

Clojure.GetVar("clojure.main", "main").invoke(); // Starts an embedded Clojure REPL

This is much simpler than:

Symbol CLOJURE_MAIN = Symbol.intern("clojure.main");
Var REQUIRE = RT.var("clojure.core", "require");
RT.var("clojure.main", "main").invoke().

Comment by Aaron Craelius [ 06/Mar/13 8:42 PM ]

This is an updated patch that supercedes the previous patch adds an AddToLoadPath method.

Comment by David Miller [ 04/Oct/14 5:55 PM ]

This was fixed with the clojure.clr.api interface. (See documentation for clojure.jvm.api.)

Generated at Tue Sep 25 04:51:24 CDT 2018 using JIRA 4.4#649-r158309.