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

7
LINES

< > BotCompany Repo | #1002788 // listToSNLTree - converts e.g. a token list to a SNL representation (quoted elements)

JavaX fragment (include)

1  
static Lisp listToSNLTree(L<S> list) {
2  
  if (empty(list)) ret lisp("emptylist");
3  
  Lisp tree = lisp(quote(last(list)));
4  
  for (int i = l(list)-2; i >= 0; i--)
5  
    tree = lisp("<", lisp(quote(list.get(i))), tree);
6  
  ret tree;
7  
}

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: #1002788
Snippet name: listToSNLTree - converts e.g. a token list to a SNL representation (quoted elements)
Eternal ID of this version: #1002788/1
Text MD5: 4d31954bd8b5a697deff36340f449db2
Author: stefan
Category: eleu / nl
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-02-24 21:35:04
Source code size: 232 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 633 / 550
Referenced in: [show references]