Package clojure.lang

Examples of clojure.lang.Var$TBox


                    {
                        Symbol namespaceSymbol = Symbol.create(symbol.getNamespace());

                        REQUIRE.invoke(namespaceSymbol);

                        Var var = Var.find(symbol);

                        final PlasticField varField = plasticClass.introduceField(Var.class, method.getName() + "Var").inject(var);

                        plasticClass.introduceMethod(desc).changeImplementation(new InstructionBuilderCallback()
                        {
View Full Code Here


        configuration.add("Default", new DefaultMapper(), "after:*");
    }

    @Startup
    public static void launchClojure() {
        Var require = RT.var("clojure.core", "require");
    }
View Full Code Here

  }

  @Test
  public void test_clojure_loading() throws Throwable {
    CodeLoader loader = new CodeLoader();
    Var incrementer = loader.clojure("check", "check", "incrementer");
    assertEquals(11L, incrementer.invoke(10L));
  }
View Full Code Here

import com.sun.javadoc.*;

public class Start {
  public static boolean start(RootDoc root) {
    RT.var("clojure.core", "require").invoke(Symbol.intern("play-clj-doclet.core"));
    Var generate = RT.var("play-clj-doclet.core", "generate-all!");
    generate.invoke(root);
    return true;
  }
View Full Code Here

    @JRubyMethod(name="==", required=1)
    public IRubyObject op_equal(ThreadContext context, IRubyObject arg) {
        Ruby runtime = context.getRuntime();
        if (arg instanceof DiametricFunction) {
            DiametricFunction other = (DiametricFunction)arg;
            Var keyword = DiametricService.getFn("clojure.core", "keyword");
            Keyword code_key = (Keyword) keyword.invoke("code");
            if (java_object.get(code_key).equals(other.java_object.get(code_key))) {
                return runtime.getTrue();
            } else {
                return runtime.getFalse();
            }
View Full Code Here

    @JRubyMethod(name={"==","eql?"}, required=1)
    public IRubyObject eql_p(ThreadContext context, IRubyObject arg) {
        Object other = DiametricUtils.convertRubyToJava(context, arg);
        try {
            Var var = DiametricService.getFn("clojure.core", "=");
            Boolean value = (Boolean)var.invoke(entity, other);
            return context.getRuntime().newBoolean(value);
        } catch (Throwable t) {
            throw context.getRuntime().newRuntimeError(t.getMessage());
        }
    }
View Full Code Here

    @JRubyMethod(name={"[]","get"}, required=1)
    public IRubyObject op_aref(ThreadContext context, IRubyObject arg) {
        String key = (String) arg.toJava(String.class);
        try {
            Var var = DiametricService.getFn("clojure.core", "get");
            Object value = var.invoke(entity, key);
            return DiametricUtils.convertJavaToRuby(context, value);
        } catch (Throwable t) {
            throw context.getRuntime().newRuntimeError(t.getMessage());
        }
    }
View Full Code Here

    @JRubyMethod(name={"has_key?","include?", "key?", "member?"}, required=1)
    public IRubyObject has_key_p(ThreadContext context, IRubyObject arg) {
        String key = (String) arg.toJava(String.class);
        try {
            Var var = DiametricService.getFn("clojure.core", "contains?");
            Boolean value = (Boolean)var.invoke(entity, key);
            return context.getRuntime().newBoolean(value);
        } catch (Throwable t) {
            throw context.getRuntime().newRuntimeError(t.getMessage());
        }
    }
View Full Code Here

    }

    @JRubyMethod
    public IRubyObject keys(ThreadContext context) {
        try {
            Var var = DiametricService.getFn("clojure.core", "keys");
            List<Object> keys = (List<Object>) var.invoke(entity);
            RubyArray ruby_keys = RubyArray.newArray(context.getRuntime());
            for (Object key : keys) {
                // keys are clojure.lang.Keyword
                ruby_keys.append(RubyString.newString(context.getRuntime(), key.toString()));
            }
View Full Code Here

    }

    @JRubyMethod
    public IRubyObject values(ThreadContext context) {
        try {
            Var var = DiametricService.getFn("clojure.core", "vals");
            List<Object> keys = (List<Object>) var.invoke(entity);
            RubyArray ruby_keys = RubyArray.newArray(context.getRuntime());
            for (Object key : keys) {
                // keys are clojure.lang.Keyword
                ruby_keys.append(RubyString.newString(context.getRuntime(), key.toString()));
            }
View Full Code Here

TOP

Related Classes of clojure.lang.Var$TBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.