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

26
LINES

< > BotCompany Repo | #1007955 // generalLispEval - evaluate according to definitions in lispTruth

JavaX fragment (include)

static O generalLispEval(Lisp l) {
  if (l == null) null;
  
  if (l.size() == 1 && lispTrue("hkihrqgdlkdayxzn", l.head))
    ret generalLispEval(l.get(0));
  
  S evaluator = first(followForwardRelation_raw("mssmzemxxztdpphw", l.head));
  if (evaluator != null)
    ret conceptCall(evaluator, map(f generalLispEval, l));
    
  S sf = first(followForwardRelation_raw("olphazqzxxnvtjcx", l.head));
  if (sf != null)
    ret makeAndCall_cached(sf, asObjectArray(map(f generalLispEval, l)));
    
  if (l.isLeaf()) {
    for (Lisp rule : lispTruth2("yrxfddfomyzlqwri"))
      if (isTrue(callConcept(rule.raw(0), l.head)))
        ret callConcept(rule.get(1), l.head);
        
    for (Lisp rule : lispTruth2("wwaprwlmqzqeaikp"))
      if (isTrue(makeAndCall_cached(rule.raw(0), l.head)))
        ret makeAndCall_cached(rule.raw(1), l.head);
  }
        
  fail("Can't evaluate " + l);
}

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: #1007955
Snippet name: generalLispEval - evaluate according to definitions in lispTruth
Eternal ID of this version: #1007955/6
Text MD5: eed548aa16914f4bcae0433ab03287aa
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-17 21:37:07
Source code size: 910 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 462 / 464
Version history: 5 change(s)
Referenced in: [show references]