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).

svoid philosophyBot_collectAndDelete(PhilosophyBot1 bot) {
  bot.addNativePredicate("!collectAndDelete $x $phrase",
    map -> {
      S var = $x(map), phrase = map.get("$phrase");
      LPair<S, SS> l = bot.matchFacts2(phrase);
      bot.deleteFacts(pairsA(l));
      ret map(l, p -> p.b.get(var));
    });
}

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: 191 / 251
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)