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

17
LINES

< > BotCompany Repo | #1002727 // putMatchX

JavaX fragment (include)

static boolean putMatchX(Map<S, Lisp> matches, S key, Lisp val) {
  if (matches.containsKey(key) && neq(matches.get(key), val)) {
    print ("key: " + key);
    fail("multi-matching not implemented");
  }
  matches.put(key, val);
  ret true;
}

static boolean putMatchX(Map<S, Lisp> matches, S key, S val) {
  ret putMatchX(matches, key, lisp(val));
}

static boolean putMatchX(Map<S, Lisp> mOuter, Map<S, Lisp> mInner, S key, S val) {
  // TODO: if it points to a literal
  ret putMatchX(mOuter, mInner.get(key).raw(), val);
}

Author comment

Began life as a copy of #1002726

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: #1002727
Snippet name: putMatchX
Eternal ID of this version: #1002727/1
Text MD5: 18f7d8e88c926cb1af38600bb86a3748
Author: stefan
Category: eleu / nl
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-02-18 19:31:51
Source code size: 543 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 572 / 563
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#3000382 - Answer for ferdie (>> t = 1, f = 0)