Package erjang

Examples of erjang.ESeq.toArray()


  @BIF
  public static ETuple list_to_tuple(EObject obj) {
    ESeq seq;
    if ((seq = obj.testSeq()) == null)
      throw ERT.badarg(obj);
    return ETuple.make(seq.toArray());
  }

  @BIF
  public static EString binary_to_list(EObject obj) {
    EBinary bin = obj.testBinary();
View Full Code Here


     
      FunID funspec;
      f = EModuleManager.resolve(funspec=new FunID(mn,fn,a.length()));
     
      if (f == null) {
        throw ERT.undef(funspec, a.toArray());
      }
     
      res = apply_last(proc, f, a);
    }
   
View Full Code Here

        ETuple2 tup2;
        if ((tup2 = ETuple2.cast(tup)) != null) {

          if (tup2.elem1 == am_args) {
            ESeq list = tup2.elem2.testSeq();
            EObject[] nargs = list.toArray();

            String[] new_cmd = new String[nargs.length + 1];
            new_cmd[0] = cmd[0];
            for (int i = 0; i < nargs.length; i++) {
              new_cmd[i + 1] = EString.make(nargs[i])
View Full Code Here

            ESeq ee;
            if ((ee = tup2.elem2.testSeq()) == null) {
              throw ERT.badarg();
            }

            EObject[] envs = ee.toArray();
            for (int i = 0; i < envs.length; i++) {
              ETuple2 e = ETuple2.cast(envs[i].testTuple());
              if (e.elem2 == ERT.FALSE) {
                env.remove(EString.make(e.elem1).stringValue());
              } else {
View Full Code Here

  @BIF
 
  static public EObject error(EObject reason, EObject args) {
    ESeq aseq = args.testSeq();
    if (aseq == null) throw ERT.badarg(reason, args);
    throw new ErlangError(reason, aseq.toArray());
  }

  @BIF(name="throw")
 
  static public EObject throw_ex(EObject reason) {
View Full Code Here

      throw ERT.badarg(a1,a2);

    if (l1.isNil()) return l1;

    // Step 1: Copy l1 to a temporary place.
    final EObject[] tmp = l1.toArray();

    // Step 2: Delete elements occurring l2 (but only once)
    int tmp_start = 0;
    for (ESeq cur = l2; !cur.isNil(); cur=cur.tail()) {
      EObject elm = cur.head();
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.