Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1024713 // filterAntiFilterListByPredicateOnIndex

JavaX fragment (include)

// pred: func(int) -> bool
static <A> Pair<L<A>> mapLike filterAntiFilterListByPredicateOnIndex(O pred, L<A> l) {
  new L<A> yes;
  new L<A> no;
  int n = l(l);
  for i to n:
    (isTrue_callF(pred, i) ? yes : no).add(l.get(i));
  ret pair(yes, no);
}

Author comment

Began life as a copy of #1024711

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024713
Snippet name: filterAntiFilterListByPredicateOnIndex
Eternal ID of this version: #1024713/1
Text MD5: 0e8042578396309f857d12def4a70423
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-24 12:38:04
Source code size: 259 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 106 / 135
Referenced in: [show references]