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

14
LINES

< > BotCompany Repo | #1025074 // repF_shortArray - call a function repeatedly, collect short[]

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

Libraryless. Click here for Pure Java version (2112L/14K).

1  
static short[] repF_shortArray(int n, O f, O... args) {
2  
  short[] a = new short[n];
3  
  for i to n:
4  
    a[i] = toShort(callF(f, args));
5  
  ret a;
6  
}
7  
8  
static short[] mapLike repF_shortArray(O f, int n) {
9  
  ret repF_shortArray(n, f);
10  
}
11  
12  
static short[] repF_shortArray(int n, IF0<Number> f) {
13  
  ret repF_shortArray(f, n);
14  
}

Author comment

Began life as a copy of #1007438

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: #1025074
Snippet name: repF_shortArray - call a function repeatedly, collect short[]
Eternal ID of this version: #1025074/3
Text MD5: 6b11973512931a8f4aa3ee9aa9f0b9f5
Transpilation MD5: f7fd5247cc2063dc39be166f58b37426
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-05 12:27:52
Source code size: 329 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 238 / 331
Version history: 2 change(s)
Referenced in: [show references]