Libraryless. Click here for Pure Java version (2729L/16K).
1 | static <A, B> L<B> mapWithIndexStartingAt1(Cl<A> l, IF2<Int, A, B> f) { |
2 | int n = l(l), i = 0; |
3 | L<B> out = emptyList(n); |
4 | fOr (A a : l) |
5 | out.add(f.get(++i, a)); |
6 | ret out; |
7 | } |
Began life as a copy of #1027129
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027656 |
Snippet name: | mapWithIndexStartingAt1 |
Eternal ID of this version: | #1027656/4 |
Text MD5: | 9ccad221443580d0e7aeff4253adfb06 |
Transpilation MD5: | f0249b8cae303a5f5f24cf0dae0a335b |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-05-13 18:22:43 |
Source code size: | 184 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 186 / 281 |
Version history: | 3 change(s) |
Referenced in: | [show references] |