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

43
LINES

< > BotCompany Repo | #1002733 // SNL Logic Engine 2

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (4064L/26K/84K).

!759

static S codeSnippetID = "#1002732";

static Lisp code;

p {
  code = snlToTree(loadSnippet(codeSnippetID));
  print(getProgramID() + ": parse result = " + code);
}

static boolean yo(Lisp snl, Map m) {
  new HashMap<S, Lisp> m2;

  // we don't know jack!
  
  if (snlMatch("i < don't < know < X", snl, m2))
    ret true;

  ret false;
}

!include #1002743 // LThread

answer {
  if (!attn()) ret null;
  
  // convert to SNL first
  s = or((S) callOpt/*Safe*/(getBot ("#1002700"), "naiveSNL", s), s);
  Lisp in = snlToTree(s);
  
  LThread thread = new LThread(code);
  thread.statements.add(snlToTree("user < says < [" + snlFromTree(in) + "]"));
  
  print("Statements: " + structure(thread.statements));
 
  if (!thread.run())
    ret null;
      
  Lisp out = first(thread.output);
  if (out != null)
    ret "[SNL: " + snlFromTree(in) + "]\n" + snlToText(out);
}

Author comment

Began life as a copy of #1002723

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: #1002733
Snippet name: SNL Logic Engine 2
Eternal ID of this version: #1002733/1
Text MD5: f23b24b7076af72013cdf707bd17b4a4
Transpilation MD5: 067c27c18c4188095b1b97e7eac82957
Author: stefan
Category: eleu / nl
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-02-19 03:24:46
Source code size: 915 bytes / 43 lines
Pitched / IR pitched: No / No
Views / Downloads: 731 / 980
Referenced in: #1002743 - LThread (include, OLDER)
#1002746 - SNL Logic Engine 3 (C is a Language)
#3000208 - Answer for bgrgndz (>> list sub bots)
#3000209 - Answer for bgrgndz (>> list sub bots)
#3000238 - Answer for stefanreich (>> t power bot)
#3000369 - Answer for Stefan (>> list sub bots)
#3000376 - Answer for stefanreich (>> list sub bots)
#3000377 - Answer for stefanreich (>> timing eleu?)
#3000380 - Answer for stefanreich (>> list sub bots)
#3000381 - Answer for speedforce (>> list sub bots)
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)