Examples of cons()


Examples of clojure.lang.IPersistentSet.cons()

    for (ISeq s=newDeps.seq(); s!=null; s=s.next()) {
      Symbol sym=(Symbol)s.first();
      if (oldDeps.contains(sym)) continue;
      IPersistentSet bs=(IPersistentSet) backDeps.valAt(sym);
      if (bs==null) bs=PersistentHashSet.EMPTY;
      backDeps=backDeps.assoc(sym, bs.cons(key));
    }
   
    // remove old back dependencies
    for (ISeq s=oldDeps.seq(); s!=null; s=s.next()) {
      Symbol sym=(Symbol)s.first();
View Full Code Here

Examples of clojure.lang.PersistentQueue.cons()

        @Override
        public PersistentQueue read(Kryo kryo, Input input, Class<PersistentQueue> type) {
            final int size = input.readInt();
            PersistentQueue q = PersistentQueue.EMPTY;
            for (int i = 0; i < size; i++)
                q.cons(kryo.readClassAndObject(input));
            return q;
        }
    }

    private static class HashSetSerializer extends CollSerializer<IPersistentSet> {
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.RDFList.cons()

    final Resource r = model.createResource(TestList.NS + "foo");

    // create a list of foos
    for (int i = 0; i < 5; i++)
    {
      list = list.cons(r);
    }

    final int listLen = list.size();

    // now append foos to the root list
View Full Code Here

Examples of com.trifork.clj_ds.IPersistentCollection.cons()

          IPersistentCollection c =
            (IPersistentCollection) map.valAt(key, empty());

          // Insert element - noting whether the map grows
          int sizeBefore = c.count();
          c = c.cons(value);
          int sizeAfter = c.count();
          map = map.assoc(key, c);

          // Update size - if the map grew
          if (sizeAfter > sizeBefore) count += 1;
View Full Code Here

Examples of com.trifork.clj_ds.IPersistentCollection.cons()

        IPersistentCollection c =
          (IPersistentCollection) map.valAt(key, empty);

        // Insert element - noting whether the map grows
        int sizeBefore = c.count();
        c = c.cons(value);
        int sizeAfter = c.count();
        map = map.assoc(key, c);
        set(map);

        // Update size - if the map grew
View Full Code Here

Examples of com.trifork.clj_ds.IPersistentCollection.cons()

        for (ISeq s = c.seq(); s != null; s = s.next()) {
          EObject val = (EObject) s.first();
          if (val == null) break;
         
          if (! obj.equalsExactly(val)) {
            out = out.cons(val);
          } else {
            deleted += 1;
          }
        }
       
View Full Code Here

Examples of com.trifork.clj_ds.PersistentHashSet.cons()

      PersistentHashSet old, links;
      try {

        do {
          old = linksref.get();
          links = (PersistentHashSet) old.cons(h);
        } while (!linksref.weakCompareAndSet(old, links));

      } catch (Exception e) {
        throw new RuntimeException(e);
      }
View Full Code Here

Examples of erjang.ECons.cons()

        MemoryMXBean bean = ManagementFactory.getMemoryMXBean();
        if (bean != null) {

          MemoryUsage mu = bean.getHeapMemoryUsage();
          res = res.cons(ETuple.make(am_heap, ERT.box(mu.getCommitted()),
              ERT.box(mu.getUsed())));

          mu = bean.getNonHeapMemoryUsage();
          res = res.cons(ETuple.make(am_non_heap, ERT.box(mu
              .getCommitted()), ERT.box(mu.getUsed())));
View Full Code Here

Examples of erjang.ECons.cons()

          MemoryUsage mu = bean.getHeapMemoryUsage();
          res = res.cons(ETuple.make(am_heap, ERT.box(mu.getCommitted()),
              ERT.box(mu.getUsed())));

          mu = bean.getNonHeapMemoryUsage();
          res = res.cons(ETuple.make(am_non_heap, ERT.box(mu
              .getCommitted()), ERT.box(mu.getUsed())));

        }
       
        return res;
View Full Code Here

Examples of erjang.ECons.cons()

        MemoryUsage mu = mb.getUsage();
        if (mu == null) continue;
       
        String name2 = (mb.getType()==MemoryType.HEAP ? "heap:" : "non_heap:" ) + name;
       
        res = res.cons(ETuple.make(EAtom.intern(name2), ERT.box(mu
            .getCommitted()), ERT.box(mu.getUsed())));

       
      }
     
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.