Examples of EFun


Examples of erjang.EFun

  }

  // reimplement this to be iterative, not recursive...
  @BIF
  public static ETuple2 mapfoldl(EProc proc, EObject fun0, EObject acc, EObject list0) throws Pausable {
    EFun fun = fun0.testFunction2(2);
    ESeq list = list0.testSeq();
   
    if (fun == null || list == null) {
      ERT.func_info(am_lists, am_mapfoldl, 3);
    }
View Full Code Here

Examples of erjang.EFun

    return ERT.FALSE;
  }

  @BIF
  public static ESeq map(EProc proc, EObject f, EObject s) throws Pausable {
    EFun fun = f.testFunction2(1);
    ESeq seq = s.testSeq();
    if (fun == null || seq == null) throw ERT.badarg(f, s);
   
    EObject[] arg = new EObject[1];
   
    ESeq rev = ERT.NIL;
    for (; !seq.isNil(); seq = seq.tail()) {
      arg[0] = seq.head();
      EObject val = fun.invoke(proc, arg);
      rev = rev.cons( val );
    }

    return reverse(rev, ERT.NIL);
  }
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.