Libraryless. Click here for Pure Java version (4091L/23K).
1 | static <A> L<WithSideValue<Int, A>> indexAsSideValue(L<A> l) { |
2 | L<WithSideValue<Int, A>> out = emptyList(l); |
3 | int n = l(l); |
4 | for i to n: |
5 | out.add(withSideValue(i, l.get(i))); |
6 | ret out; |
7 | } |
Began life as a copy of #1027129
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033149 |
Snippet name: | indexAsSideValue |
Eternal ID of this version: | #1033149/2 |
Text MD5: | 0789955cca3b2cc0b27d9ac9efa4477d |
Transpilation MD5: | 11af507dc93e027e0cf83ce8713c981b |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-15 19:01:52 |
Source code size: | 199 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 186 / 244 |
Version history: | 1 change(s) |
Referenced in: | [show references] |