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

24
LINES

< > BotCompany Repo | #1014197 // mechMapCI - mech list as case-insensitive map

JavaX fragment (include)

// name -> (name, parsed map)
static Map<S, Pair<S, SS>> mechMapCI_cache = synchroMap();

please include function parseDoubleLeftArrowMapCI_tlft.

static SS mechMapCI(S listName) {
  Pair<S, SS> p = mechMapCI_cache.get(listName);
  S text = mechList_raw(listName);
  if (p != null && eq(p.a, text)) ret p.b;
  S parsing = first(mechList_opt(listName + " | Parsing"));
  SS map;
  if (parsing == null)
    map = parseDoubleArrowMapCI(tlft(text));
  else
    ifdef FancyMechParsing
      map = asCIMap((SS) callAndMake(parsing, text));
    endifdef
    ifndef FancyMechParsing
      map = asCIMap((SS) callMC(parsing, text));
    endifndef
  p = pair(text, map);
  mechMapCI_cache.put(listName, p);
  ret p.b;
}

Author comment

Began life as a copy of #1014191

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: #1014197
Snippet name: mechMapCI - mech list as case-insensitive map
Eternal ID of this version: #1014197/11
Text MD5: 0fca4d7ec42328e4ca6e6b8d3b7c773c
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-31 11:58:55
Source code size: 732 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 494 / 598
Version history: 10 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1014201 - mechTreeCI - tree-formatted mech list as case-insensitive tree
#1014211 - mechMapCI_uncached - mech list as case-insensitive map
#1014237 - mechCIMap - synomy of mechMapCI - mech list as case-insensitive map
#1014240 - mechMapCI_leftArrows
#1015750 - mechHashMap - mech map as normal HashMap
#1016354 - mechMultiMapCI - mech list as case-insensitive multimap