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

14
LINES

< > BotCompany Repo | #1002722 // snlApply

JavaX fragment (include)

static S snlApply(S snl, Map<S, Lisp> matches) {
  ret snlFromTree(snlApply(snlToTree(snl), matches));
}

static Lisp snlApply(Lisp tree, Map<S, Lisp> matches) {
  if (tree == null) ret null;
  if (tree.isEmpty())
    ret or(matches.get(tree.head), tree);

  Lisp lisp = new Lisp(tree.head);
  for (Lisp child : tree)
    lisp.add(snlApply(child, matches));
  ret lisp;
}

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: #1002722
Snippet name: snlApply
Eternal ID of this version: #1002722/1
Text MD5: 1f5c8c19bd7f79032630e34661a5ef33
Author: stefan
Category: nl bots
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-02-18 00:36:06
Source code size: 386 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 716 / 770
Referenced in: [show references]