Class ChainedDefine

All Implemented Interfaces:
JepComponent, PostfixMathCommandI, Serializable

public class ChainedDefine extends Define
An extension to the Define function that allows chained functions to be created.
Node node = jep.parse("define('sq',seq=>seq.map(x=>x^2),'square a sequence','Function,Chained');");
Object res = jep.evaluate(node);
jep.reinitializeComponents();
node = jep.parse("[1..5] . sq()");
res = jep.evaluate(node);
* An optional fourth parameter is a comma separated list of options.
  • Chained the function is a chained function seq . fun(arg)
  • Chainable the function is a chainable function evaluated as seq . fun(arg) , or fun(arg,seq)
  • BinarySwapped the function is a binary function with arguments swapped in a chained context fun(seq,arg) or seq . fun(arg)
Since:
4.1
See Also: