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

19
LINES

< > BotCompany Repo | #1033977 // VarContext

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

Transpiled version (72L) is out of date.

sclass VarContext {
  VarContext parent;
  MapSO vars;
  
  *() {}
  *(VarContext *parent) {}
  
  O get(S name) {
    if (containsKey(vars, name))
      ret mapGet(vars, name);
    if (parent != null)
      ret parent.get(name);
    null;
  }
  
  void set aka put(S name, O value) {
    vars = mapPutOrCreate(vars, name, value);
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033977
Snippet name: VarContext
Eternal ID of this version: #1033977/4
Text MD5: fbd103db508ce2a652e63d69cd52379c
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-15 06:54:18
Source code size: 354 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 16 / 38
Version history: 3 change(s)
Referenced in: [show references]