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

22
LINES

< > BotCompany Repo | #1002827 // Test class Prolog (including native stuff)

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

Libraryless. Click here for Pure Java version (1539L/10K/33K).

!752

static new Prolog p;

static void test(Lisp l) {
  print(l + " => " + p.canSolve(l));
}

p {
  p.addClause(lisp("yes"));
  
  test(lisp("yes"));
  test(lisp("no"));
  
  // Test native
  
  test(lisp("nativeTest"));
  test(lisp("isQuoted", "x"));
  test(lisp("isQuoted", "A"));
  test(lisp("isQuoted", "\"hello\""));
  test(lisp("isQuoted", "\"hello\"", "\"hello\"")); // will fail (2 args instead of 1)
}

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: #1002827
Snippet name: Test class Prolog (including native stuff)
Eternal ID of this version: #1002827/1
Text MD5: 3e9b7d37d760717e1b036a0cf431ce50
Transpilation MD5: e7c61ae6cc9fffb75ae5f5f4da32762a
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-02-29 04:24:27
Source code size: 432 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 569 / 554
Referenced in: [show references]