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)

static O pcallF(O f, O... args) {
  ret pcallFunction(f, args);
}

ifclass F0
static <A> A pcallF(F0<A> f) null on exception {
  ret f == null ? null : f.get();
}
endif

ifclass F1
static <A, B> B pcallF(F1<A, B> f, A a) null on exception {
  ret f == null ? null : f.get(a);
}
endif

ifclass VF1
static <A> void pcallF(VF1<A> f, A a) {
  pcall {
    if (f != null) f.get(a);
  }
}
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: 417 / 899
Version history: 4 change(s)
Referenced in: #1006654 #1010837 #1020756

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