Package erjang

Examples of erjang.ETuple2


      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);
      } else {
        return new ETuple2(vals, new ESetCont(matcher, map_seq, ordered, limit));
      }
    }
View Full Code Here


    for (; !opts.isNil(); opts = opts.tail()) {
      EObject option = opts.head();

      EAtom atom;
      ETuple2 t2;
      ETuple3 t3;
      if ((atom = option.testAtom()) != null) {
        if (atom == am_bag || atom == am_duplicate_bag
            || atom == am_set || atom == am_ordered_set) {
          type = atom;
View Full Code Here

      throw ERT.badarg(nameOrTid, matchSpec);
    }
   
    EObject res = table.select(spec, -1);

    ETuple2 tup;
    if (res == am_$end_of_table) {
      return ERT.NIL;
    } else if ((tup=ETuple2.cast(res)) != null
        && (seq = tup.elem1.testSeq()) != null) {
      return seq;
View Full Code Here

  }

  @BIF static public EObject update_element(EProc proc, EObject tab, EObject key, EObject upd) {
    ETable table = resolve(proc, tab, true);
   
    ETuple2 t_upd = ETuple2.cast(upd);
    ESeq   s_upd = upd.testSeq();
   
    if (table == null
        || (t_upd == null && s_upd == null
        || !(table.type==am_set || table.type==am_ordered_set)) {
View Full Code Here

    } else {
      ETuple candidate = (ETuple) map.valAt(key);
      if (candidate == null) return Native.am_$end_of_table;
      EObject res;
      if ((res = matcher.match(candidate)) != null) {
        return new ETuple2(ERT.NIL.cons(res), Native.am_$end_of_table);
      }
    }
   
    return Native.am_$end_of_table;
  }
View Full Code Here

        }

        ETuple rep = null;
       
        for (ESeq next = upd ; !next.isNil() ; next = next.tail()) {
          ETuple2 update = ETuple2.cast(next.head());
          if (update == null) return null;
          ESmall idx1 = update.elem1.testSmall();
          if (idx1 == null
              || idx1.value < 1
              || idx1.value > rec.arity()
View Full Code Here

  private void send_empty_out_q_msgs() throws Pausable {

    if (empty_out_q_subs.isEmpty())
      return;

    ETuple2 msg = new ETuple2(am_empty_out_q, port());
    for (EHandle h : empty_out_q_subs) {
      h.send(port(), msg);
    }
  }
View Full Code Here

  }

  private void tcp_closed_message() throws Pausable {
    if ((tcp_add_flags & TCP_ADDF_CLOSE_SENT) == 0) {
      tcp_add_flags |= TCP_ADDF_CLOSE_SENT;
      driver_output_term(new ETuple2(am_tcp_closed, port()));
    }
  }
View Full Code Here

      out.flip();
      data = EBinary.make(tail);
    }

    ETuple res = ETuple.make(am_inet_async, port(), ERT.box(op.id),
        new ETuple2(ERT.am_ok, data));

    if (log.isLoggable(Level.FINER)) {
      log.finer("sending to " + op.caller + " ! " + res);
    }
View Full Code Here

    /*
     * send message:* {inet_reply, Port, Ref, {error,Reason}}
     */
    EHandle caller = this.caller;
    this.caller = null;
    ETuple msg = ETuple.make(am_inet_reply, port(), new ETuple2(
        ERT.am_error, reason));
    if (portlog.isLoggable(Level.FINER)) {
      portlog.finer("sending to " + caller + " ! " + msg);
    }
   
View Full Code Here

TOP

Related Classes of erjang.ETuple2

Copyright © 2018 www.massapicom. 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.