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

13
LINES

< > BotCompany Repo | #1000630 // call function(s) for reflective calls to objects/classes

JavaX fragment (include)

sO call(O o) {
  return callF(o);
}

// varargs assignment fixer for a single string array argument
sO call(O o, S method, S[] arg) {
  ret call(o, method, new O[] {arg});
}

sO call(O o, S method, O... args) {
  //ret call_cached(o, method, args);
  ret call_withVarargs(o, method, args);
}

Author comment

Began life as a copy of #2000497

Now safer

download  show line numbers  debug dex  old transpilations   

Travelled to 20 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lnbujpyubztb, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, podlckwnjdmb, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv

Comments [hide]

ID Author/Program Comment Date
797 #1000604 (pitcher) 2015-08-20 15:28:24

add comment

Snippet ID: #1000630
Snippet name: call function(s) for reflective calls to objects/classes
Eternal ID of this version: #1000630/21
Text MD5: a70d744c4e0e7c72e8ce9714461f9a17
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-24 12:28:41
Source code size: 303 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 1145 / 10982
Version history: 20 change(s)
Referenced in: #1001199 - callOpt - now forwards to callOpt_withVarargs
#1002427 - Accellerating 629 (SPIKE)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1007832 - callMC_cached [OLD]
#1007856 - preciseCall - better method resolution. Could optimize method lookup
#1015936 - castCall - call + magic cast
#1018502 - call_uncached
#1023480 - rcall - call with method name first
#1031368 - call_optional - wrap result in Optional or null if method not found
#1031601 - callWithEnter
#3000382 - Answer for ferdie (>> t = 1, f = 0)