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

1  
!7
2  
3  
sclass Entry {
4  
  S text;
5  
}
6  
7  
module ELERewrites > DynObjectTable<Entry> {
8  
  transient S input;
9  
  transient Set<S> rewrites = ciSet();
10  
  
11  
  start { ele_onInput(lambda1 setInput); }
12  
  
13  
  // API
14  
  
15  
  void setInput(S input) enter {
16  
    dm_q(r {
17  
      if (setField(+input))
18  
        clearRewrites();
19  
    });
20  
  }
21  
  
22  
  void clearRewrites() {
23  
    rewrites.clear();
24  
    clear();
25  
  }
26  
  
27  
  void addRewrite(S input, S text) q {
28  
    if (eq(input, ELERewrites.this.input) && rewrites.add(text))
29  
      add(nu Entry(+text));
30  
  }
31  
}

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: 124 / 5012
Version history: 4 change(s)
Referenced in: [show references]