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

9
LINES

< > BotCompany Repo | #1025798 // philosophyBot_collectAndDelete

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (7464L/48K).

1  
svoid philosophyBot_collectAndDelete(PhilosophyBot1 bot) {
2  
  bot.addNativePredicate("!collectAndDelete $x $phrase",
3  
    map -> {
4  
      S var = $x(map), phrase = map.get("$phrase");
5  
      LPair<S, SS> l = bot.matchFacts2(phrase);
6  
      bot.deleteFacts(pairsA(l));
7  
      ret map(l, p -> p.b.get(var));
8  
    });
9  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1025798
Snippet name: philosophyBot_collectAndDelete
Eternal ID of this version: #1025798/2
Text MD5: 4fe7e483c6ab557847d59e73388b03cb
Transpilation MD5: 9c6abf971d27cac43926c0cf25eb2687
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-20 16:53:06
Source code size: 317 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 190 / 251
Version history: 1 change(s)
Referenced in: [show references]