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

31
LINES

< > BotCompany Repo | #1026651 // ELE: Rewrites

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

Libraryless. Click here for Pure Java version (18528L/133K).

!7

sclass Entry {
  S text;
}

module ELERewrites > DynObjectTable<Entry> {
  transient S input;
  transient Set<S> rewrites = ciSet();
  
  start { ele_onInput(lambda1 setInput); }
  
  // API
  
  void setInput(S input) enter {
    dm_q(r {
      if (setField(+input))
        clearRewrites();
    });
  }
  
  void clearRewrites() {
    rewrites.clear();
    clear();
  }
  
  void addRewrite(S input, S text) q {
    if (eq(input, ELERewrites.this.input) && rewrites.add(text))
      add(nu Entry(+text));
  }
}

Author comment

Began life as a copy of #1026531

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

-
Snippet ID: #1026651
Snippet name: ELE: Rewrites
Eternal ID of this version: #1026651/5
Text MD5: 986333175583ecb88bb2995649d96525
Transpilation MD5: 2f3c8f07a2346e97f4385bff59a61967
Author: stefan
Category: javax / electric logic engine
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-19 20:45:40
Source code size: 546 bytes / 31 lines
Pitched / IR pitched: No / No
Views / Downloads: 195 / 5093
Version history: 4 change(s)
Referenced in: