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)

1  
static <A> L<A> getLast(L<A> l, int n) {
2  
  ret subList(l, l(l)-n);
3  
}
4  
5  
static <A> L<A> getLast(int n, L<A> l) {
6  
  ret getLast(l, n);
7  
}

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: 494 / 588
Referenced in: [show references]