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)

static L map_precise(Iterable l, O f) {
  ret map_precise(f, l);
}

static L mapLike map_precise(O f, Iterable l) {
  new L x;
  O mc = mc();
  for (O o : unnull(l))
    x.add(callF_precise(f, o));
  ret x;
}

static L map_precise(O f, O[] l) {
  ret map_precise(f, asList(l));
}

static L map_precise(O f, Map map) {
  ret map_precise(map, f);
}

static L map_precise(Map map, O f) {
  new L x;
  for (O _e : map.entrySet()) {
    Map.Entry e = (Map.Entry) _e;
    x.add(callF_precise(f, e.getKey(), e.getValue()));
  }
  ret x;
}

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: 482 / 511
Version history: 1 change(s)
Referenced in: [show references]