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

28
LINES

< > BotCompany Repo | #1009337 // map_precise - like map(), but use precise calling

JavaX fragment (include)

1  
static L map_precise(Iterable l, O f) {
2  
  ret map_precise(f, l);
3  
}
4  
5  
static L mapLike map_precise(O f, Iterable l) {
6  
  new L x;
7  
  O mc = mc();
8  
  for (O o : unnull(l))
9  
    x.add(callF_precise(f, o));
10  
  ret x;
11  
}
12  
13  
static L map_precise(O f, O[] l) {
14  
  ret map_precise(f, asList(l));
15  
}
16  
17  
static L map_precise(O f, Map map) {
18  
  ret map_precise(map, f);
19  
}
20  
21  
static L map_precise(Map map, O f) {
22  
  new L x;
23  
  for (O _e : map.entrySet()) {
24  
    Map.Entry e = (Map.Entry) _e;
25  
    x.add(callF_precise(f, e.getKey(), e.getValue()));
26  
  }
27  
  ret x;
28  
}

Author comment

Began life as a copy of #1003239

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1009337
Snippet name: map_precise - like map(), but use precise calling
Eternal ID of this version: #1009337/2
Text MD5: d48a3638da6d710dbf8e95fc1c3be456
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-24 14:15:17
Source code size: 558 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 420 / 445
Version history: 1 change(s)
Referenced in: [show references]