Examples of arity()


Examples of erjang.ETuple.arity()

        } else if (tup != null && tup.arity() == 3 && tup.elm(1) == am_capture) {
          this.capture_spec = tup.elm(2);
          this.capture_type = tup.elm(3);

        } else if (tup != null && tup.arity() == 2
            && tup.elm(1) == am_offset
            && (off=tup.elm(2).testSmall()) != null) {
          this.offset = off.value;

        } else {
View Full Code Here

Examples of erjang.ETuple.arity()

      }
    } else if (matcher instanceof ValuePattern) {
      ValuePattern vp = (ValuePattern) matcher;
      if (vp.value instanceof ETuple) {
        ETuple et = (ETuple) vp.value;
        if (keypos1 < 1 || keypos1 > et.arity())
          return null;
        return et.elm(keypos1);
      }
    }
    return null;
View Full Code Here

Examples of erjang.ETuple.arity()

        return arr;
      }

      ETuple tup;
      if ((tup = val.testTuple()) != null) {
        int length = tup.arity();
        Class<?> componentType = type.getComponentType();
        Object arr = Array.newInstance(componentType, length);

        for (int index = 0; index < length; index++) {
          Object value = JavaObject.unbox(self, componentType, tup
View Full Code Here

Examples of erjang.ETuple.arity()

    if (port == null) {
      throw ERT.badarg(node_arg, cid_arg, type_arg);
    }

    ETuple t = type_arg.testTuple();
    if (t.arity() != 4) {
      throw ERT.badarg(node_arg, cid_arg, type_arg);
    }
   
    ESmall flags = t.elm(1).testSmall();
    ESmall version = t.elm(2).testSmall();
View Full Code Here

Examples of erjang.ETuple.arity()

  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.ETuple.arity()

        // {'EXIT', From, Reason} comes in this way
        if (t3.elem1 == ERT.am_EXIT) {
          // close is handled by exception handling code
          return;
        }
      } else if ((tup = msg.testTuple()) != null && tup.arity() == 5) {
        // {'DOWN', ref, process, pid, reason}
        if (tup.elm(1) == ERT.am_DOWN) {
          ERef ref = tup.elm(2).testReference();
          instance.processExit(ref);
        }
View Full Code Here

Examples of erjang.ETuple.arity()

  private static EObject get_elm(EObject tab, EObject key, ESmall p,
      ESeq ent) {
   
    ETuple tup = ent.head().testTuple();
    if (tup == null || p.value < 1 || p.value > tup.arity()) {
      throw ERT.badarg(tab, key, p);
    }
   
    return tup.elm(p.value);
  }
View Full Code Here

Examples of erjang.ETuple.arity()

          set(map);
          return rec.elm(idx);
         
        } else if ((one=upd.testTuple()) != null) {
         
          if (one.arity() == 2) {
            ESmall eidx = one.elm(1).testSmall();
            incr = one.elm(2).testInteger();
            if (eidx == null || eidx.value > rec.arity() || incr == null) return null;
            int idx = eidx.value;
           
View Full Code Here

Examples of erjang.ETuple.arity()

            map = map.assoc(get_key(rec), rec);
           
            set(map);
            return rec.elm(idx);

          } else if (one.arity() == 4){
           
            ESmall eidx = one.elm(1).testSmall();
            incr = one.elm(2).testInteger();
            EInteger threshold = one.elm(3).testInteger();
            EInteger setvalue = one.elm(4).testInteger();
View Full Code Here

Examples of erjang.ETuple.arity()

    ESmall i = idx.testSmall();
    ETuple t = tup.testTuple();
    if (i == null || t == null) {
      return null;
    }
    if (i.value > t.arity())
      return null;

    return t.elm(i.value);
  }
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.