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

11
LINES

< > BotCompany Repo | #1032499 // bestOfN

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Compilation Failed (4402L/25K).

1  
static <A> Scored<A> lambdaMapLike bestOfN(IF1<A, Double> scoreFunction, int n, IF0<A> produce) {
2  
  new Best<A> best;
3  
  
4  
  repeat n {
5  
    A a = produce!;
6  
    double score = scoreFunction.get(a);
7  
    best.put(a, score);
8  
  }
9  
  
10  
  ret best.scored();
11  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032499
Snippet name: bestOfN
Eternal ID of this version: #1032499/2
Text MD5: fab9102d0360960640db5984b18c82f8
Transpilation MD5: cce0b79dfe706c6310befda383101320
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-10 18:17:36
Source code size: 258 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 175 / 236
Version history: 1 change(s)
Referenced in: [show references]