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

23
LINES

< > BotCompany Repo | #1005301 - pcallF - synonym of pcallFunction

JavaX fragment (include)

1  
static O pcallF(O f, O... args) {
2  
  ret pcallFunction(f, args);
3  
}
4  
5  
ifclass F0
6  
static <A> A pcallF(F0<A> f) null on exception {
7  
  ret f == null ? null : f.get();
8  
}
9  
endif
10  
11  
ifclass F1
12  
static <A, B> B pcallF(F1<A, B> f, A a) null on exception {
13  
  ret f == null ? null : f.get(a);
14  
}
15  
endif
16  
17  
ifclass VF1
18  
static <A> void pcallF(VF1<A> f, A a) {
19  
  pcall {
20  
    if (f != null) f.get(a);
21  
  }
22  
}
23  
endif

Author comment

Began life as a copy of #1003403

download  show line numbers  debug dex   

Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, jcllbfdqhrgy, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, podlckwnjdmb, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, whxojlpjdney, yanjaxplzisb

No comments. add comment

Snippet ID: #1005301
Snippet name: pcallF - synonym of pcallFunction
Eternal ID of this version: #1005301/5
Text MD5: 02ca23d9a07efc49ff47f4f8c6e4b5f0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-05-20 18:56:40
Source code size: 409 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 418 / 900
Version history: 4 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1005301 & http://1005301.tinybrain.de