Difference between revisions of "Array.collect()"

From ZCubes Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
Also same as [[Array.suchthat() | Array.suchthat()]]
 
Also same as [[Array.suchthat() | Array.suchthat()]]
  
 +
Related to
 +
 +
Array.filteroncondition= function (SomeTakeDropOrAllFlag, SomeFunction, SomeParameter)
 +
 +
Matches are applied to element or rows in an array with SomeFunctions and SomeParameter mentioned. ''
  
 
Related to  
 
Related to  
Line 8: Line 13:
  
 
2 12 - dropwhile
 
2 12 - dropwhile
 +
 +
  
 
asvector versions work on elements/arrays at the top level. The simple versions work at every element level (goes into subarrays when need be).
 
asvector versions work on elements/arrays at the top level. The simple versions work at every element level (goes into subarrays when need be).
  
Array.prototype.collectwhile=Array.prototype.filteroncondition.curry(0);
+
Each element is used to match for the following:
 +
 
 +
Array.collectwhile=Array.filteroncondition.curry(0);
  
Array.prototype.suchthat=Array.prototype.filteroncondition.curry(0);
+
Array.suchthat=Array.filteroncondition.curry(0);
  
Array.prototype.collect=Array.prototype.suchthat;
+
Array.collect=Array.suchthat;
  
Array.prototype.takewhile=Array.prototype.filteroncondition.curry(1);
+
Array.takewhile=Array.filteroncondition.curry(1);
  
Array.prototype.dropwhile=Array.prototype.filteroncondition.curry(2);
+
Array.dropwhile=Array.filteroncondition.curry(2);
  
 +
Each element at top level is used to match for the following:
  
Array.prototype.collectwhileasvector=Array.prototype.filteroncondition.curry(10);
+
Array.collectwhileasvector=Array.filteroncondition.curry(10);
  
Array.prototype.suchthatasvector=Array.prototype.filteroncondition.curry(10);
+
Array.suchthatasvector=Array.filteroncondition.curry(10);
  
Array.prototype.collectasvector=Array.prototype.suchthatasvector;
+
Array.collectasvector=Array.suchthatasvector;
  
Array.prototype.takewhileasvector=Array.prototype.filteroncondition.curry(11);
+
Array.takewhileasvector=Array.filteroncondition.curry(11);
  
Array.prototype.dropwhileasvector=Array.prototype.filteroncondition.curry(12);
+
Array.dropwhileasvector=Array.filteroncondition.curry(12);
  
  
Array.prototype.splitwhile=Array.prototype.partitiononcondition.curry(0);
+
Array.splitwhile=Array.partitiononcondition.curry(0);
  
Array.prototype.splitwhileasvector=Array.prototype.partitiononcondition.curry(10);
+
Array.splitwhileasvector=Array.partitiononcondition.curry(10);
  
To be documented.
+
To be documented in more detail.

Revision as of 15:54, 4 February 2020

Also same as Array.suchthat()

Related to

Array.filteroncondition= function (SomeTakeDropOrAllFlag, SomeFunction, SomeParameter)

Matches are applied to element or rows in an array with SomeFunctions and SomeParameter mentioned.

Related to 0 10 - takeall

1 11 - takewhile

2 12 - dropwhile


asvector versions work on elements/arrays at the top level. The simple versions work at every element level (goes into subarrays when need be).

Each element is used to match for the following:

Array.collectwhile=Array.filteroncondition.curry(0);

Array.suchthat=Array.filteroncondition.curry(0);

Array.collect=Array.suchthat;

Array.takewhile=Array.filteroncondition.curry(1);

Array.dropwhile=Array.filteroncondition.curry(2);

Each element at top level is used to match for the following:

Array.collectwhileasvector=Array.filteroncondition.curry(10);

Array.suchthatasvector=Array.filteroncondition.curry(10);

Array.collectasvector=Array.suchthatasvector;

Array.takewhileasvector=Array.filteroncondition.curry(11);

Array.dropwhileasvector=Array.filteroncondition.curry(12);


Array.splitwhile=Array.partitiononcondition.curry(0);

Array.splitwhileasvector=Array.partitiononcondition.curry(10);

To be documented in more detail.