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

17
LINES

< > BotCompany Repo | #1007462 // clParse - Computer Language to Lisp

JavaX fragment (include)

static Lisp clParse(S s) {
  L<S> tok = tok_groupRoundBrackets(s);
  if (l(tok) == 1) null;
  Lisp l = lisp(unquote(tok.get(1)));
  for (int i = 3; i < l(tok); i += 2) {
    S t = tok.get(i);
    if (t.startsWith("(") && t.endsWith(")"))
      l.add(assertNotNull(clParse(dropFirstAndLast(t))));
    else
      l.add(lisp(aiUsing(unquote(t))));
  }
  ret l;
}

static L<Lisp> clParse(L<S> l) {
  ret map(f clParse, l);
}

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: #1007462
Snippet name: clParse - Computer Language to Lisp
Eternal ID of this version: #1007462/6
Text MD5: fc9a600f0e337d9228950f7cc7a52800
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-02 19:28:37
Source code size: 436 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 583 / 595
Version history: 5 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)