C# 클래스 clojure.lang.Hosting.Clojure

Convenience class for interfacing with Clojure from other .NET languages. Provides an extremely simple way to retreive Clojure vars and invoke Clojure functions.
파일 보기 프로젝트 열기: aaronc/clojure-clr

공개 메소드들

메소드 설명
AddNamespaceLoadMapping ( string namespaceBase, string directory ) : void

Allows a namespace to be loaded from a directory whose path corresponds to only part of the namespace name. This can be used to load .clj files properly from the repl that are being stored as embedded resources in mixed language .NET DLL's (for example existing C# and Visual Basic projects).

Adding a load mapping from "MyCompany.MyProject" to "MyProject" allows the namespace "A.B.C" to be stored in "MyProject/C.clj" on the file system. Assuming the default namespace (configurable in a Visual Studio project's properties) is "MyCompany.MyProject", "C.clj" can be stored as an embedded resource in "MyProject.dll" and still loaded properly by the Clojure namespace loader. This is because embedded resources receive a virtual filename in a DLL based on both the DLL's default namespace and the file's actual path relative to the project. In order for the namespace to be loaded from the repl, a load mapping must be created. AddNamespaceLoadMapping("MyCompany.MyProject", "MySolutionDir/MyProject");

AddToLoadPath ( string path ) : void

Adds a path to the CLOJURE_LOAD_PATH environment variable used to load Clojure files from the disk.

GetVar ( string nsname, string varName ) : Var

Returns the Var object refered to in the namespace called nsname with the name varName.

Require ( string nsname ) : void

Calls (require nsname) on the namespace name provided by nsname.

메소드 상세

AddNamespaceLoadMapping() 공개 정적인 메소드

Allows a namespace to be loaded from a directory whose path corresponds to only part of the namespace name. This can be used to load .clj files properly from the repl that are being stored as embedded resources in mixed language .NET DLL's (for example existing C# and Visual Basic projects).
Adding a load mapping from "MyCompany.MyProject" to "MyProject" allows the namespace "A.B.C" to be stored in "MyProject/C.clj" on the file system. Assuming the default namespace (configurable in a Visual Studio project's properties) is "MyCompany.MyProject", "C.clj" can be stored as an embedded resource in "MyProject.dll" and still loaded properly by the Clojure namespace loader. This is because embedded resources receive a virtual filename in a DLL based on both the DLL's default namespace and the file's actual path relative to the project. In order for the namespace to be loaded from the repl, a load mapping must be created. AddNamespaceLoadMapping("MyCompany.MyProject", "MySolutionDir/MyProject");
public static AddNamespaceLoadMapping ( string namespaceBase, string directory ) : void
namespaceBase string
directory string
리턴 void

AddToLoadPath() 공개 정적인 메소드

Adds a path to the CLOJURE_LOAD_PATH environment variable used to load Clojure files from the disk.
public static AddToLoadPath ( string path ) : void
path string The path to add to CLOJURE_LOAD_PATH. Use ; to separate multiple paths.
리턴 void

GetVar() 공개 정적인 메소드

Returns the Var object refered to in the namespace called nsname with the name varName.
public static GetVar ( string nsname, string varName ) : Var
nsname string The namespace name
varName string The name of the Var
리턴 Var

Require() 공개 정적인 메소드

Calls (require nsname) on the namespace name provided by nsname.
public static Require ( string nsname ) : void
nsname string The name of the namespace to require, ex.: /// clojure.string
리턴 void