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

18
LINES

< > BotCompany Repo | #1010421 // mapToStringArray

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

Transpiled version (7991L) is out of date.

// this is pretty bad, who needs this?
static S[] mapToStringArray(Map map) {
  new L l;
  for (O o : keys(map)) {
    l.add(o);
    l.add(map.get(o));
  }
  ret toStringArray(l);
}

// this is the good one
static <A> S[] lambdaMapLike mapToStringArray(IF1<A, S> f, Iterable<A> l) {
  ret toStringArray(map(f, l));
}

static <A> S[] mapToStringArray(Iterable<A> l, IF1<A, S> f) {
  ret mapToStringArray(f, l);
}

Author comment

Began life as a copy of #1006543

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: #1010421
Snippet name: mapToStringArray
Eternal ID of this version: #1010421/4
Text MD5: 83f70b73189c952f442bac48bbd45223
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-10-13 20:44:26
Source code size: 428 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 513 / 577
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)