1 | // isSep: func(A) -> bool |
2 | static <A> L<L<A>> groupNonEmpty(L<A> l, O isSep) { |
3 | new L<L<A>> out; |
4 | int j = 0; |
5 | for (int i = 0; i < l(l); i++) { |
6 | bool sep = isTrue(callF(isSep, l.get(i))); |
7 | if (sep) { |
8 | if (i > j) |
9 | out.add(newSubList(l, j, i)); |
10 | j = i+1; |
11 | } |
12 | } |
13 | if (l(l) > j) |
14 | out.add(newSubList(l, j)); |
15 | ret out; |
16 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1005100 |
Snippet name: | groupNonEmpty |
Eternal ID of this version: | #1005100/1 |
Text MD5: | d85e18fe996fd306f0aa4425ec6ac3b1 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-10-16 17:20:37 |
Source code size: | 361 bytes / 16 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 555 / 562 |
Referenced in: | [show references] |