clojureclojureclr

How can I use .net functions/classes to/from clojure-clr?


For example, how can I use System.Console.WriteLine from clojure-clr? In general, what's the rule for exporting/importing functions/classes from other languages such as C#/F# from/to Clojure-clr?


Solution

  • System.Console is loaded by default. You can simply use:

    (System.Console/WriteLine "Hello World!")
    

    Another example, using a static class:

    (import (System.IO Path))
    (println (Path/GetFullPath "."))