Libraryless. Click here for Pure Java version (4520L/25K).
// possible binary legacy signature static <A> L<Pair<A>> listToPairs(L<A> l) { ret listToPairs((Iterable<A>) l); } static <A> L<Pair<A>> listToPairs(Iterable<A> or A[] l) { new LPair<A> out; Iterator<A> it = iterator(l); while ping (it.hasNext()) { A a = it.next(); if (!it.hasNext()) break; A b = it.next(); addPair(out, a, b); } ret out; }
Began life as a copy of #1012216
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: | #1012218 |
Snippet name: | listToPairs - group elements in pairs; drops last element if single |
Eternal ID of this version: | #1012218/4 |
Text MD5: | 87ccfde7637fdfc696b72775b8e7237e |
Transpilation MD5: | e75d8f7c27c7d00977a81a48b82a8730 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-25 01:59:44 |
Source code size: | 387 bytes / 16 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 503 / 593 |
Version history: | 3 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1014575 - listToOverlappingPairs #1026536 - llPairs |