On Wed, Oct 28, 2009 at 12:21 AM, Alex Osborne wrote:
>
> Jeff Brown wrote:
>
>> I can invoke a function using Java code that looks something like this...
>>
>> Reader reader = new FileReader("clj/demo.clj");
>> Compiler.load(reader);
>> Var var = RT.var("demo", "add_numbers");
>> Object result =
Jeff Brown wrote:
> I can invoke a function using Java code that looks something like this...
>
> Reader reader = new FileReader("clj/demo.clj");
> Compiler.load(reader);
> Var var = RT.var("demo", "add_numbers");
> Object result = var.invoke(4, 7);
> System.out.println("Result: " + result);
>
If I have something like this...
(ns demo)
(defn add_numbers ([x] x)
([x & rest-args] (reduce + (cons x rest-args
(defmacro silly_adder [sum]
(let [addend# (for [i (range sum)] 1)]
`(add_numbers ~...@addend#)))
(defmacro even_sillier_adder [sum]
`(silly_adder ~(+ sum 5)))
I