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

25
LINES

< > BotCompany Repo | #1023161 // I want you to be... [prelude spike]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (3430L/19K).

!7

cmodule IWantYouToBe > DynPrintLog {
  class Rule1 extends WordTokRule {
    *() { super("I want you to be my assistant", "assistant"); }
    
    run {
      emit("I want that {you are my " + getVar("assistant") + "}");
    }
  }
  
  <A extends RuleOnString> A process(A rule, S s) {
    rule.process(s);
    ret rule;
  }
  
  start-thread {
    assertNull(process(new Rule1, "I want you to be his friend").map);
    new Rule1 r;
    printStruct(assertEquals(litcimap("assistant", "girl"),
      process(r, "I want you to be my girl").map));
    assertEmitsContainIC(r, "I want that {you are my girl}");
    printDone();
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023161
Snippet name: I want you to be... [prelude spike]
Eternal ID of this version: #1023161/13
Text MD5: d3a88e13e79975f696c91fd14de4d8cc
Transpilation MD5: 63e278be89669a1cf329520e2b47b94b
Author: stefan
Category: javax / a.i.
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-05-15 23:33:02
Source code size: 657 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 307 / 519
Version history: 12 change(s)
Referenced in: [show references]