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

7
LINES

< > BotCompany Repo | #1003611 // getLast - get n last entries of list - returns a live sublist

JavaX fragment (include)

static <A> L<A> getLast(L<A> l, int n) {
  ret subList(l, l(l)-n);
}

static <A> L<A> getLast(int n, L<A> l) {
  ret getLast(l, n);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1003611
Snippet name: getLast - get n last entries of list - returns a live sublist
Eternal ID of this version: #1003611/1
Text MD5: b2d5b540ad93409acaa5a28e48497133
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-14 15:37:27
Source code size: 139 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 564 / 661
Referenced in: [show references]