Package erjang

Examples of erjang.ETuple.arity()


    while (!list.isNil()) {
      EObject elm = list.head();
      ETuple tup = elm.testTuple();

      // test that it is a tuple of the right size
      if (tup != null && tup.arity() >= nth.value) {       
        EObject val = tup.elm(nth.value);
        if (val.equals(key)) { return ERT.TRUE; }
      }
     
      list = list.tail();
View Full Code Here


    while (!list.isNil()) {
      EObject elm = list.head();
      ETuple tup = elm.testTuple();

      // test that it is a tuple of the right size
      if (tup != null && tup.arity() >= nth.value) {       
        EObject val = tup.elm(nth.value);
        if (val.equals(key)) { return tup; }
      }
     
      list = list.tail();
View Full Code Here

    while (!src.isNil()) {
      EObject elm = src.head();
     
      ETuple tup;
      if ((tup = elm.testTuple()) != null) {
        if (tup.arity() >= index) {
          if (tup.elm(index).equals(k)) {
            return new ETuple2(ERT.am_value, tup);
          }
        }
      }
View Full Code Here

  @BIF
  public static EObject delete_element(EObject idx0, EObject tup0)
  {
    ESmall idx = idx0.testSmall();
    ETuple tup = tup0.testTuple();
    if (idx == null || tup == null || idx.value < 1 || idx.value > tup.arity())
      throw ERT.badarg(idx0, tup0);
   
    EObject[] vals = new EObject[tup.arity()-1];
    int target = 0;
    for (int i = 0; i < tup.arity(); i++) {
View Full Code Here

    ESmall idx = idx0.testSmall();
    ETuple tup = tup0.testTuple();
    if (idx == null || tup == null || idx.value < 1 || idx.value > tup.arity())
      throw ERT.badarg(idx0, tup0);
   
    EObject[] vals = new EObject[tup.arity()-1];
    int target = 0;
    for (int i = 0; i < tup.arity(); i++) {
      if ((i+1) != idx.value) {
        vals[target++] = tup.elm(i+1);
      }
View Full Code Here

    if (idx == null || tup == null || idx.value < 1 || idx.value > tup.arity())
      throw ERT.badarg(idx0, tup0);
   
    EObject[] vals = new EObject[tup.arity()-1];
    int target = 0;
    for (int i = 0; i < tup.arity(); i++) {
      if ((i+1) != idx.value) {
        vals[target++] = tup.elm(i+1);
      }
    }
   
View Full Code Here

  public static EObject
  insert_element(EObject idx0, EObject tup0, EObject term)
  {
    ESmall idx = idx0.testSmall();
    ETuple tup = tup0.testTuple();
    if (idx == null || tup == null || idx.value < 1 || idx.value > tup.arity()+1)
      throw ERT.badarg(idx0, tup0);
   
    EObject[] vals = new EObject[tup.arity()+1];
    int target = 0;
    for (int i = 0; i < tup.arity(); i++) {
View Full Code Here

    ESmall idx = idx0.testSmall();
    ETuple tup = tup0.testTuple();
    if (idx == null || tup == null || idx.value < 1 || idx.value > tup.arity()+1)
      throw ERT.badarg(idx0, tup0);
   
    EObject[] vals = new EObject[tup.arity()+1];
    int target = 0;
    for (int i = 0; i < tup.arity(); i++) {
      if ((i+1) == idx.value) {
        vals[target++] = term;
      }
View Full Code Here

    if (idx == null || tup == null || idx.value < 1 || idx.value > tup.arity()+1)
      throw ERT.badarg(idx0, tup0);
   
    EObject[] vals = new EObject[tup.arity()+1];
    int target = 0;
    for (int i = 0; i < tup.arity(); i++) {
      if ((i+1) == idx.value) {
        vals[target++] = term;
      }
     
      vals[target++] = tup.elm(i+1);
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.