Package erjang

Examples of erjang.ESmall


    return a2.setelement(index.value, term);
  }

  @BIF(type = Type.GUARD, name = "element")
  static public EObject element$g(EObject idx, EObject tup) {
    ESmall i = idx.testSmall();
    ETuple t = tup.testTuple();
    if (i == null || t == null) {
      return null;
    }
    if (i.value > t.arity())
View Full Code Here


    return t.elm(i.value);
  }

  @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

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

  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

    return ERT.guard(a1 == a2);
  }

  @BIF(name = "=:=", type = Type.GUARD)
  public static final EAtom eqxp(EObject a1, ESmall s2) {
    ESmall s1;
    if ((s1 = a1.testSmall()) != null) {
      return ERT.guard(s1.value == s2.value);
    }

    return ERT.guard(s2.equalsExactly(a1));
View Full Code Here

    @BIF(type=Type.GUARD, name="is_record")
            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

   
  }
 
  @BIF
  public static ETuple make_tuple(EObject arity, EObject initial) {
    ESmall sm = arity.testSmall();
    if (sm == null || sm.value < 0) throw ERT.badarg(arity, initial);
    ETuple et = ETuple.make(sm.value);
    for (int i = 1; i <= sm.value; i++) {
      et.set(i, initial);
    }
View Full Code Here

  {
    ETuple2 dt;
    if ((dt=ETuple2.cast(a1)) != null) {
      ETuple3 date;
      ETuple3 time;
      ESmall year;
      ESmall month;
      ESmall day;
      ESmall hour;
      ESmall minute;
      ESmall sec;
      if (   (date=ETuple3.cast( dt.elem1 )) != null
        && (year = date.elem1.testSmall()) != null
        && (month = date.elem2.testSmall()) != null
        && (day = date.elem3.testSmall()) != null
       
View Full Code Here

  {
    ETuple2 dt;
    if ((dt=ETuple2.cast(a1)) != null) {
      ETuple3 date;
      ETuple3 time;
      ESmall year;
      ESmall month;
      ESmall day;
      ESmall hour;
      ESmall minute;
      ESmall sec;
      if (   (date=ETuple3.cast( dt.elem1 )) != null
        && (year = date.elem1.testSmall()) != null
        && (month = date.elem2.testSmall()) != null
        && (day = date.elem3.testSmall()) != null
       
View Full Code Here

  {
    ETuple2 dt;
    if ((dt=ETuple2.cast(a1)) != null) {
      ETuple3 date;
      ETuple3 time;
      ESmall year;
      ESmall month;
      ESmall day;
      ESmall hour;
      ESmall minute;
      ESmall sec;
      if (   (date=ETuple3.cast( dt.elem1 )) != null
        && (year = date.elem1.testSmall()) != null
        && (month = date.elem2.testSmall()) != null
        && (day = date.elem3.testSmall()) != null
       
View Full Code Here

TOP

Related Classes of erjang.ESmall

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.