Package clojure.lang

Examples of clojure.lang.Keyword


    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
    public IRubyObject lang(ThreadContext context) {
        Keyword lang = (Keyword)java_object.get(DiametricService.keywords.get("lang"));
        return context.getRuntime().newString(lang.toString());
    }
View Full Code Here

        }
        if (!(args[0] instanceof RubySymbol)) {
            throw context.getRuntime().newArgumentError("The first argument should be a Symbol");
        }
        RubyString edn_string = (RubyString)RuntimeHelpers.invoke(context, args[0], "to_s");
        Keyword partition = Keyword.intern((String)edn_string.asJavaString());
        RubyClass clazz = (RubyClass)context.getRuntime().getClassFromPath("Diametric::Persistence::Object");
        DiametricObject diametric_object = (DiametricObject)clazz.allocate();
        try {
            clojure.lang.Var clj_var = DiametricService.getFn("datomic.api", "tempid");
            if (args.length > 1 && (args[1] instanceof RubyFixnum)) {
View Full Code Here

    }

    private IRubyObject createFunction(ThreadContext context, RubySymbol arg) {
        try {
            Var keyword_fn = DiametricService.getFn("clojure.core", "keyword");
            Keyword entityKey = (Keyword) keyword_fn.invoke(arg.toString());
            Var entity_fn = DiametricService.getFn("datomic.api", "entity");
            Entity entity = (Entity) entity_fn.invoke(database, entityKey);
            datomic.function.Function function = (Function) entity.get(DiametricService.keywords.get("db/fn"));
            RubyClass clazz = (RubyClass)context.getRuntime().getClassFromPath("Diametric::Persistence::Function");
            DiametricFunction diametric_function = (DiametricFunction)clazz.allocate();
View Full Code Here

    }

    private long toJFaceTokenDuration;
    private IToken toJFaceToken() {
      long start = System.currentTimeMillis();
    Keyword type = (Keyword) currentToken.get(tokenTypeKeyword);
    if (type.equals(symbolKeyword)) {
            type = guessEclipseTokenTypeForSymbol(text.substring(currentOffset, currentOffset + ((Long) currentToken.get(tokenLengthKeyword)).intValue()));
        }
    IToken retToken = parserTokenKeywordToJFaceToken.get(type);
        if (retToken == null) {
            retToken = Token.UNDEFINED;
View Full Code Here

  private long guessEclipseTokenTypeForSymbolDuration;
  private long getSymbolTypeDuration;
    private Keyword guessEclipseTokenTypeForSymbol(String symbol) {
      long start = System.currentTimeMillis();
      Keyword res;
      if (symbolLiterals.contains(symbol)) {
        res = Keyword.intern("literalSymbol");
      } else {
        long sttart = System.currentTimeMillis();
        res = context.getSymbolType(symbol, isCallableSymbol);
View Full Code Here

      return PreferenceConstants.callable_RAW_SYMBOL_Token;
    */
    if (clojureSymbolTypesCache.containsKey(symbol)) {
      return getCallableOrNonCallable(clojureSymbolTypesCache.get(symbol), isCallableSymbol);
    } else {
      Keyword symbolType =  (Keyword) coreSymbolType.invoke(symbol)
 
      if (symbolType == null) {
        clojureSymbolTypesCache.put(symbol, PreferenceConstants.RAW_SYMBOL_Token);
        return getCallableOrNonCallable(PreferenceConstants.RAW_SYMBOL_Token, isCallableSymbol);
      } else {
View Full Code Here

    }
  };
 
  private Keyword getCallableOrNonCallable(Keyword symbolKeyword, boolean isCallableSymbol) {
    if (isCallableSymbol) {
      Keyword callableFlavor = symbolToCallable.get(symbolKeyword);
      if (callableFlavor != null) {
        return callableFlavor;
      } else {
        return symbolKeyword;
      }
View Full Code Here

        return new ClojureBSONMap();
    }

    @Override
    protected IPersistentMap injectId(IPersistentMap doc) {
        Keyword keyword = Keyword.intern(Symbol.intern("_id"));
        if (!doc.containsKey(keyword)) {
            return doc.assoc(keyword, new ObjectId());
        }
        return doc;
    }
View Full Code Here

        return returnValue;
    }

    private String toString(Object key) {
        if (key instanceof Keyword) {
            Keyword keyword = (Keyword) key;
            return keyword.getName();
        }
        return key.toString();
    }
View Full Code Here

TOP

Related Classes of clojure.lang.Keyword

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.