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

16
LINES

< > BotCompany Repo | #1018075 // nlLogic_checkFirstConditions2 - returns number of succeeded conditions too

JavaX fragment (include)

sbool nlLogic_checkFirstConditions2_debug;

// returns (number of succeeded conditions, remaining conditions)
static Pair<Int, Exp> nlLogic_checkFirstConditions2(NLLogicChecker_v2 c, IfThen rule, NLLogicChecker_v2.Matching m) {
  Exp exp = rule.in;
  int succeeded = 0;
  while ping (exp != null) {
    Pair<Bool, Exp> p = c.checkFirstCondition(exp, m);
    if (nlLogic_checkFirstConditions2_debug)
      print("nlLogic_checkFirstConditions2: exp=" + exp + ", p=" + p);
    if (!p.a) break;
    ++succeeded;
    exp = p.b;
  }
  ret pair(succeeded, exp);
}

Author comment

Began life as a copy of #1018054

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018075
Snippet name: nlLogic_checkFirstConditions2 - returns number of succeeded conditions too
Eternal ID of this version: #1018075/1
Text MD5: 97838a39a7851d354e4a53fc8f8b0a8e
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-29 15:08:00
Source code size: 571 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 263 / 297
Referenced in: [show references]