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

14
LINES

< > BotCompany Repo | #1022259 // lazyMap_noSave - map list to list lazily (calculating elements on demand each time)

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (4569L) is out of date.

1  
static <A, B> L<B> lambdaMapLike lazyMap_noSave(IF1<A, B> f, L<A> l) {
2  
  ret new RandomAccessAbstractList<B> {
3  
    final int size = l(l);
4  
5  
    public int size() { ret size; }
6  
    public B get(int i) {
7  
      ret f.get(l.get(i));
8  
    }
9  
  };
10  
}
11  
12  
static <A, B> L<B> lambdaMapLike lazyMap_noSave(L<A> l, IF1<A, B> f) {
13  
  ret lazyMap_noSave(f, l);
14  
}

Author comment

Began life as a copy of #1018394

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, elmgxqgtpvxh, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022259
Snippet name: lazyMap_noSave - map list to list lazily (calculating elements on demand each time)
Eternal ID of this version: #1022259/3
Text MD5: 00e736dbc29809793cba0f1cc1e29a8d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-08-03 08:21:03
Source code size: 351 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 281 / 371
Version history: 2 change(s)
Referenced in: [show references]