Examples of ESeq


Examples of erjang.ESeq

  @BIF
  public static EObject tuple_to_list(EObject tup) {
    ETuple t;
    if ((t=tup.testTuple()) == null) { throw ERT.badarg(tup); }

    ESeq res = ERT.NIL;
    for (int i = t.arity(); i > 0; i--) {
      EObject e = t.elm(i);
      res = res.cons(e==null?ERT.NIL:e);
    }
   
    return res;
  }
View Full Code Here

Examples of erjang.ESeq

      this.limit = limit;
    }
 
    public EObject select() {
      int count = 0;
      ESeq vals = ERT.NIL;
     
      ISeq map_seq = this.ent;
      while (seq_has_more(map_seq) && (limit < 0 || count < limit)) {
       
        IMapEntry mape = (IMapEntry) map_seq.first();
        map_seq = map_seq.next();
       
        ETuple candidate = (ETuple) mape.getValue();
        EObject res;
        if ((res = matcher.match(candidate)) != null) {
          count += 1;
          vals = vals.cons(res);
        }
      }
      if (ordered) vals = vals.reverse();

      if (vals == ERT.NIL) {
        return Native.am_$end_of_table;
      } else if (!seq_has_more(map_seq)) {
        return new ETuple2(vals, Native.am_$end_of_table);
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.