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

12
LINES

< > BotCompany Repo | #1027874 // SymVar - symbolic variable [object identity/global ID based equality]

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

Libraryless. Click here for Pure Java version (2850L/18K).

1  
// Note: Identity based on globalID, so eq(new SymVar("a"), new SymVar("a")) is FALSE.
2  
sclass SymVar > HasGlobalID {
3  
  S name;
4  
  
5  
  *() {}
6  
  *(S *name) {}
7  
  
8  
  public bool equals(O o) { ret o instanceof IHasGlobalID && eqHasGlobalID(this, (IHasGlobalID) o); }
9  
  public int hashCode() { ret _hashCode(globalID); }
10  
  
11  
  toString { ret "SymVar" + (nempty(name) ? " " + name : "") + "[" + globalID() + "]"; }
12  
}

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: #1027874
Snippet name: SymVar - symbolic variable [object identity/global ID based equality]
Eternal ID of this version: #1027874/9
Text MD5: cbe2fac8a311e6d7013f956b91ac5f2c
Transpilation MD5: 05cfb621e741eb2a3e01c411abbe9731
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-13 21:32:26
Source code size: 417 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 209 / 530
Version history: 8 change(s)
Referenced in: [show references]