Examples of arity()


Examples of erjang.ETuple.arity()

  @BIF
  static public EObject element(EObject idx, EObject tup) {
    ESmall i = idx.testSmall();
    ETuple t = tup.testTuple();
    if (i == null || t == null || i.value < 1 || i.value > t.arity()) {
      throw ERT.badarg(idx, tup);
    }

    return t.elm(i.asInt());
  }
View Full Code Here

Examples of erjang.ETuple.arity()

  }

  @BIF
  static public EObject element(int idx, EObject obj) {
    ETuple tup;
    if ((tup = obj.testTuple()) != null && tup.arity() >= idx) {
      return tup.elm(idx);
    }
    throw ERT.badarg(new ESmall(idx), obj);
  }
View Full Code Here

Examples of erjang.ETuple.arity()

      if ((b = o.testBinary()) == null)
        throw ERT.badarg(o);
     
      return ERT.box(b.byteSize());
    }
    return ERT.box(t.arity());
  }

  @BIF
  public static final ESmall size(ETuple t) {
    return ERT.box(t.arity());
View Full Code Here

Examples of erjang.ETuple.arity()

  @BIF(type = Type.GUARD, name = "size")
  public static final ESmall size$g(EObject o) {
    ETuple t;
    if ((t = o.testTuple()) != null)
      return ERT.box(t.arity());

    EBinary b;
    if ((b = o.testBinary()) != null)
      return ERT.box(b.byteSize());
   
View Full Code Here

Examples of erjang.ETuple.arity()

    @BIF(type=Type.GUARD, name="is_record")
            public static EAtom is_record$g(EObject term, EObject tag) {
                EAtom atag = tag.testAtom();
                ETuple tup = term.testTuple();
                boolean ok = ( (atag != null) && (tup != null)
                                && (tup.arity() > 0)
                                && (tup.elm(1) == atag) );
                if (ok) return ERT.TRUE;
                else return null;
  }
View Full Code Here

Examples of erjang.ETuple.arity()

            public static EAtom is_record$g(EObject term, EObject tag, EObject size) {
                EAtom atag = tag.testAtom();
                ETuple tup = term.testTuple();
                ESmall siz = size.testSmall();
                boolean ok = ( (atag != null) && (tup != null) && (siz != null)
                                && (tup.arity() == siz.value)
                                && (tup.elm(1) == atag) );
                if (ok) return ERT.TRUE;
                else return null;
  }
View Full Code Here

Examples of erjang.ETuple.arity()

  @BIF
  public static ESmall tuple_size(EObject tup) {
    ETuple t;
    if ((t = tup.testTuple()) == null)
      throw ERT.badarg(tup);
    return ERT.box(t.arity());
  }

  @BIF(type = Type.GUARD, name = "tuple_size")
  public static ESmall tuple_size_guard(EObject tup) {
    ETuple t;
View Full Code Here

Examples of erjang.ETuple.arity()

  @BIF(type = Type.GUARD, name = "tuple_size")
  public static ESmall tuple_size_guard(EObject tup) {
    ETuple t;
    if ((t = tup.testTuple()) == null)
      return null;
    return ERT.box(t.arity());
  }

  @BIF
  public static ESmall byte_size(EObject o) {
    EBitString bin = o.testBitString();
View Full Code Here

Examples of io.airlift.airline.Option.arity()

                    }

                    List<String> options = ImmutableList.copyOf(optionAnnotation.name());
                    String description = optionAnnotation.description();

                    int arity = optionAnnotation.arity();
                    Preconditions.checkArgument(arity >= 0 || arity == Integer.MIN_VALUE, "Invalid arity for option %s", name);

                    if (optionAnnotation.arity() >= 0) {
                        arity = optionAnnotation.arity();
                    }
View Full Code Here

Examples of jcgp.backend.resources.Resources.arity()

  @Override
  public void mutate() {
    Resources resources = chromosome.getResources();
   
    // choose to mutate the function or a connection
    int geneType = resources.getRandomInt(1 + resources.arity());
   
    // if the int is less than 1, mutate function, else mutate connections
    if (geneType < 1) {     
      setFunction(resources.getRandomFunction());
    } else {
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.