Package clojure.lang

Examples of clojure.lang.IFn.applyTo()


                add(stormConf);
                add(context);
                add(collectorMap);
            }};
           
            _bolt = (IBolt) preparer.applyTo(RT.seq(args));
            //this is kind of unnecessary for clojure
            try {
                _bolt.prepare(stormConf, context, collector);
            } catch(AbstractMethodError ame) {
               
View Full Code Here


    @Override
    public Map<String, Object> getComponentConfiguration() {
        IFn hof = Utils.loadClojureFn(_confSpec.get(0), _confSpec.get(1));
        try {
            return (Map) hof.applyTo(RT.seq(_params));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
View Full Code Here

                add(conf);
                add(context);
                add(collectorMap);
            }};
           
            _spout = (ISpout) preparer.applyTo(RT.seq(args));
            //this is kind of unnecessary for clojure
            try {
                _spout.open(conf, context, collector);
            } catch(AbstractMethodError ame) {
               
View Full Code Here

   
    @Override
    public Map<String, Object> getComponentConfiguration() {
        IFn hof = Utils.loadClojureFn(_confSpec.get(0), _confSpec.get(1));
        try {
            return (Map) hof.applyTo(RT.seq(_params));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }   
}
View Full Code Here

        // compute result
        Object[] ps=new Object[arity];
        for (int i=0; i<arity; i++) {
          ps[i]=((Constant<?>)nParams[i]).getValue();
        }
        return Constant.create(fn.applyTo(RT.seq(ps)));
      }
    }
    return update(nFunc,nParams);
  }
View Full Code Here

      d=params[i].compute(d, bindings);
      if (d.isExiting()) return d;
      args[i]=d.getResult();
    }
   
    return d.withResult(fn.applyTo(ArraySeq.create(args)));
  }
 
  @Override
  public boolean isPure() {
    if (!func.isPure()) return false;
View Full Code Here

   
    Expression fn=analyse(first);
    if (KissUtils.isMacro(fn)) {
      // TODO: macro expend with expansion passing?
      IFn macroFn=(IFn) fn.eval(Environment.EMPTY);
      Object expandedForm=macroFn.applyTo(RT.cons(form,RT.cons(PersistentHashMap.EMPTY, form.next())));
      return analyse(expandedForm);
    }
   
    ISeq paramSeq=RT.next(form);
    int paramCount=RT.count(paramSeq);
View Full Code Here

          add(registrationArgument);
          add(context);
          add(errorReporter);
        }};

      _fn = (IMetricsConsumer) preparer.applyTo(RT.seq(args));

      try {
        _fn.prepare(conf, registrationArgument, context, errorReporter);
      } catch (AbstractMethodError ame) {
View Full Code Here

  private void bootClojure() {
    if(!_booted) {
      try {
        IFn hof = Utils.loadClojureFn(_fnSpec.get(0), _fnSpec.get(1));
        _factory = (StateFactory) hof.applyTo(RT.seq(_params));
        _booted = true;
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
View Full Code Here

    _params = params;
    _fnSpec = fnSpec;

    try {
      IFn hof = Utils.loadClojureFn(_fnSpec.get(0), _fnSpec.get(1));
      _aggregator = (ReducerAggregator) hof.applyTo(RT.seq(_params));
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.