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

41
LINES

< > BotCompany Repo | #1030019 // Gazelle Question Triple Test [dev.]

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

Uses 1059K of libraries. Click here for Pure Java version (2886L/15K).

!7

cmodule2 QuestionTripleTest > DynPrintLog {
  switchable S multiBotModule;
  switchable long mainPostID;
  transient GazellePost mainPost, variation, q1, q2, a1, a2;
  
  start-thread {
    mainPost = importPost(dm_call(multiBotModule, "getPost", mainPostID));
    print(+mainPost);
    if (mainPost == null) ret;
    variation = importPost(first((L) dm_call(multiBotModule, "repliesWithTag", mainPost.importedFrom, "variation of")));
    print(+variation);
    if (variation == null) ret;
    
    q1 = replyWithType(mainPost, "Question");
    print(+q1);
    q2 = replyWithType(variation, "Question");
    print(+q2);
    a1 = replyWithType(q1, "Answer");
    print(+a1);
    a2 = replyWithType(q2, "Answer");
    print(+a2);
  }
  
  GazellePost importPost(O post) {
    if (post == null) null;
    GazellePost p = cast quickImport(post);
    p.importedFrom = post;
    ret p;
  }
  
  GazellePost replyWithTag(GazellePost post, S tag) {
    ret post == null ? null : importPost(first((L) dm_call(multiBotModule, "repliesWithTag", post.importedFrom, tag)));
  }
  
  GazellePost replyWithType(GazellePost post, S type) {
    if (post == null) null;
    ret objectWhereIC(lmap importPost((L) dm_call(multiBotModule, "repliesTo", post.importedFrom)), +type);
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030019
Snippet name: Gazelle Question Triple Test [dev.]
Eternal ID of this version: #1030019/13
Text MD5: 9936b1252a4ebe5821a0c54e75e8b8dc
Transpilation MD5: 9fd069b26bb09a0800d9f6c977232a5a
Author: stefan
Category: javax / gazelle.rocks
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-10-30 10:05:32
Source code size: 1309 bytes / 41 lines
Pitched / IR pitched: No / No
Views / Downloads: 255 / 447
Version history: 12 change(s)
Referenced in: [show references]