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

21
LINES

< > BotCompany Repo | #1007438 // repF - call a function repeatedly, collect into list

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

Transpiled version (7886L) is out of date.

static L repF(int n, O f, O... args) {
  L l = emptyList(n);
  for i to n:
    l.add(callF(f, args));
  ret l;
}

static L repF(O f, int n) {
  ret repF(n, f);
}

static <A> L<A> lambdaMapLike repF(int n, IF0<A> f) {
  L<A> l = emptyList(n);
  for i to n:
    l.add(f.get());
  ret l;
}

static <A> L<A> repF(IF0<A> f, int n) {
  ret repF(n, f);
}

Author comment

Began life as a copy of #1002635

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1007438
Snippet name: repF - call a function repeatedly, collect into list
Eternal ID of this version: #1007438/13
Text MD5: 84920c80bcdae5fffb5ea9d0a5e2f750
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-15 00:42:00
Source code size: 367 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 618 / 775
Version history: 12 change(s)
Referenced in: [show references]