<< Back to previous view

[CLJCLR-13] Add namespace DescriptionAttribute to init type Created: 06/Mar/13  Updated: 27/Mar/13  Resolved: 27/Mar/13

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: 0
Labels: None

Attachments: Text File namespace-desc.patch    
Patch: Code

 Description   

leiningen on the JVM uses a small library called bultitude to search the classpath for namespaces. To acheive the same functionality in ClojureCLR we would need to add some descriptive information to the compiler generated _Init_$.

I'm suggesting adding a System.ComponentModel.DescriptionAttribute with a clojure readable string of information describing what namespace(s) this init type loads. This would allow someone to query all the loaded assemblies for namespaces, without necessarily trying to load all of them. Oftentimes the namespace itself is slightly different than what the init type would imply - for instance _Init_$clojure/pprint/column_writer is for the namespace clojure.pprint.

The attached patch, adds a DescriptionAttribute based on the final value of RT.CurrentNSVar after compiling. Conceivably, a single file could load several namespaces, but this seems like a rare case - it could be handled, however, by adding a watch to RT.CurrentNSVar. If this seems useful, the patch can be modified to use this method.



 Comments   
Comment by David Miller [ 27/Mar/13 9:40 PM ]

https://github.com/clojure/clojure-clr/commit/01b46505ac902e3a1ad2167ad0b0e0689d45f716

Generated at Fri Aug 01 05:05:47 CDT 2014 using JIRA 4.4#649-r158309.