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

18
LINES

< > BotCompany Repo | #1007849 // class Thoughts

JavaX fragment (include)

sclass Thoughts {
  new LinkedHashSet<Lisp> statements;
  new MultiMap<S, Lisp> statementsByHead;
  
  bool add(Lisp statement) {
    if (statement == null) false;
    bool isNew = statements.add(statement);
    if (isNew)
      statementsByHead.put(statement.head, statement);
    ret isNew;
  }
  
  // assumes s is a global ID
  bool has(S s) {
    assertPossibleGlobalID(s);
    ret statements.contains(lisp(s));
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1007849
Snippet name: class Thoughts
Eternal ID of this version: #1007849/6
Text MD5: f5d8bfb74d2ac6c484678a493919795c
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-13 14:00:00
Source code size: 439 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 512 / 1090
Version history: 5 change(s)
Referenced in: [show references]