Skip to content

Instantly share code, notes, and snippets.

@retran
Created July 24, 2015 13:48
Show Gist options
  • Save retran/c8ad3b385ca3c19437b8 to your computer and use it in GitHub Desktop.
Save retran/c8ad3b385ca3c19437b8 to your computer and use it in GitHub Desktop.
using System;
namespace clojure_test
{
class Program
{
static void Main(string[] args)
{
var eval = clojure.lang.RT.var("clojure.core", "load-string");
eval.invoke("(def my-func (fn [a b] (+ a b)))");
var result1 = eval.invoke("(my-func 1 2)");
Console.WriteLine(result1);
eval.invoke("(def my-func (fn [a b] (- a b)))");
var result2 = eval.invoke("(my-func 1 2)");
Console.WriteLine(result2);
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment