Questions tagged [clojureclr]

An implementation of the Clojure language that runs on the Common Language Runtime (CLR). This could include Microsoft's CLR or Mono.

36 questions
3
votes
1 answer

Can't call Clojure clr static method from C# application

I'm getting exception An object reference is required for the non-static field, method, or … here is what am I trying to do : ;; Here's the program.clj file from a VsClojure project. ;; First thing you need to do is add the :methods property ;;…
cnd
  • 32,616
  • 62
  • 183
  • 313
3
votes
1 answer

Editor for ClojureCLR

Is there an editor for ClojureCLR with REPL support and brace matching? I found a project which adds support for ClojureCLR to Visual Studio: vsClojure, but couldn't build it. Are there any other options?
Max
  • 19,654
  • 13
  • 84
  • 122
3
votes
3 answers

Clojure: Getting single value and map in structmap

I have a sequence of values that I get from somewhere else, in a known order. I also have one separate value. Both of these I want to put into a struct. I.e. (defstruct location :name :id :type :visited) Now I have a list (list "Name" "Id"…
Kurt Schelfthout
  • 8,880
  • 1
  • 30
  • 48
3
votes
1 answer

Write a lazy sequence of lines to a file in ClojureClr without reflection

I have a large lazy seq of lines that I want to write to a file. In C#, I would use System.IO.File/WriteAllLines which has an overload where the lines are either string[] or IEnumerable. I want to do this without using reflection at…
agent-j
  • 27,335
  • 5
  • 52
  • 79
3
votes
1 answer

reify, ToString

Probably obvious, but given this code (from http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/reify): (defn reify-str [] (let [f "foo"] (reify Object (ToString [this] f)))) (defn -main [& args] (println…
Daniel Cotter
  • 1,342
  • 2
  • 15
  • 27
2
votes
2 answers

Can't set CLOJURE_LOAD_PATH; getting TypeInitializationError from runtime

I'm trying to run Clojure on the CLR and getting stuck on some basic issues. Based on this question I am using the following code: In program.clj: (ns program (:require [clojure.core]) (:gen-class :methods [#^{:static true} [output [int int]…
Daniel Cotter
  • 1,342
  • 2
  • 15
  • 27
2
votes
1 answer

What does Clojure.Main.exe and Clojure.Compile.exe do?

I downloaded clojure-clr, and I found that it has two execution binaries - Clojure.Main.exe and Clojure.Compile.exe. I see that Clojure.Main.exe is REPL, and I'm not sure what Clojure.Compile.exe does. What do those two tools do exactly?
prosseek
  • 182,215
  • 215
  • 566
  • 871
2
votes
2 answers

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?
prosseek
  • 182,215
  • 215
  • 566
  • 871
2
votes
0 answers

Unable to call "load-string" from C# project with Clojure >= 1.8

I have a C# project that loads and calls a custom Clojure function via load-string. This works fine with Clojure 1.7 (installed via NuGet). However, when if I upgrade to the latest pre-release (1.9.0-alpha13), the following exception is thrown upon…
Anonymous
  • 739
  • 7
  • 15
2
votes
1 answer

ClojureClr source macro: Source not found for standard library functions

I'm trying to print the source code for a function but I get Source not found user=> (source map) ; Source not found ; nil I am using ClojureClr 1.6.0 by running Clojure.Main.exe. I don't have any clojure .clj source files. What am I…
Orlando Osorio
  • 3,116
  • 7
  • 29
  • 52
2
votes
1 answer

Can't find clojure.set in ClojureClr

I am using ClojureClr 1.6.0 and I'm trying to use clojure.set but I can't find it: user=> (doc clojure.set/union) ; nil When I try to use it, I get: user=> (clojure.set/union #{1 2} #{3}) ; TypeNotFoundException Unable to find type: clojure.set…
Orlando Osorio
  • 3,116
  • 7
  • 29
  • 52
1
vote
0 answers

How to call a generic method from c# in clojure

I have a generic method in c# like UseStartup in c# and i want to use it in clojureclr, now i have create a ns like (ns myapp.startup (gen-class :name myapp.Startup)) but i wonder how to pass it to the c# generic method
John Smith
  • 153
  • 1
  • 7
1
vote
1 answer

using clojure-clr as script interpreter

I have a very simple clojure interpreter set up in C# that loads a .clj file and makes the functions available for consumption within AutoCAD. This works well but I'd like to set this up with a bit more structure so that I can 'module-ize' the…
Mick Duprez
  • 115
  • 2
  • 10
1
vote
1 answer

ClojureCLR coercion error

I'm getting a compiler exception in the ClojureCLR REPL for basic coercion: => (class 12) System.Int64 => (class 12.34) System.Double => (class (new System.Double 12)) CompilerException System.InvalidOperationException: No constructor in type:…
1
vote
1 answer

Call non-virtual protected methods from a Java/C# subclass in Clojure/ClojureCLR

When making a subclass in Clojure using gen-class, you can expose protected virtual(non-final) methods through exposes-methods, however it is implemented through overriding, which cannot work for non-virtual(final) methods. Is the only way to call…
Devin Garner
  • 1,361
  • 9
  • 20