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

25
LINES

< > BotCompany Repo | #1002618 // callAnswerMethod

JavaX fragment (include)

static int callAnswerMethod_version;

static S callAnswerMethod(S s) {
  if (callAnswerMethod_version == 0)
    if (hasMethod(mc(), "answer", "", new L)) callAnswerMethod_version = 1;
    else if (hasMethod(mc(), "answer", "")) callAnswerMethod_version = 2;
    else callAnswerMethod_version = -1;
  
  if (callAnswerMethod_version == 1)
    ret (S) callMC("answer", s, emptyList());
  else if (callAnswerMethod_version == 2)
    ret (S) callMC("answer", s);
  null;
}

static S callAnswerMethod(O responder, S s) {
  ret callAnswerMethod(responder, s, litlist(s));
}

static S callAnswerMethod(O responder, S s, L<S> history) {
  S answer = (S) callOpt(responder, "answer", s, history);
  if (answer == null)
    answer = (S) callOpt(responder, "answer", s);
  return emptyToNull(answer);
}

Author comment

Began life as a copy of #1001800

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1002618
Snippet name: callAnswerMethod
Eternal ID of this version: #1002618/5
Text MD5: 07777c4bef75093e5078d0fe4c60059b
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-24 00:27:38
Source code size: 815 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 631 / 568
Version history: 4 change(s)
Referenced in: [show references]