ClojureCLR

Enhance compiler support for loading namespace from .NET assemblies

Details

  • Type: Enhancement Enhancement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code

Description

This patch adds support for:

1) Loading .clj files from .NET assemblies as embedded resources.

2) AOT compiling multiple Clojure namespaces into a single .NET assembly. To do this the _Init_ class name has to be unique for each assembly. Actual compilation of multiple namespaces into .DLL's would be done by a separate tool such as ILMerge or nleinigen.

3) Loading a clojure namespace from a custom path other than that specified by its namespace. This is useful for loading .clj files at the repl that are being integrated into existing .NET projects as embedded resources. For example say my namespace is MyCompany.MyProject.MyNamespace and I want to integrate it into the C# project MyProject as an embedded resource. I create the file SolutionFolder\MyProject\MyNamespace.clj on the disk. As long as the default namespace for MyProject is MyCompany.MyProject, the file will actually be stored as an embedded resource with the path Clojure expects (MyCompany.MyProject.MyNamespace.clj). But, from the repl, we need to tell Clojure to load namespaces beginning with MyCompany.MyProject from SolutionFolder\MyProject. The function add-ns-load-mapping (whose name I'm not attached to) does this.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: