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

9
LINES

< > BotCompany Repo | #1002849 // nlToCons

JavaX fragment (include)

1  
static Lisp nlToCons(Lisp term) {
2  
  if (term.isLeaf() /*|| !term.is("[]")*/)
3  
    ret lisp("[]", "cons", term, "end");
4  
  int n = term.size();
5  
  Lisp x = lisp("end");
6  
  for (int i = n-1; i >= 0; i--)
7  
    x = lisp("[]", "cons", term.get(i), x);
8  
  ret x;
9  
}

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: #1002849
Snippet name: nlToCons
Eternal ID of this version: #1002849/1
Text MD5: 6cccdd6a7afe125ed553d8c7b14e37f1
Author: stefan
Category: eleu / nl
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-03-03 18:05:53
Source code size: 262 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 698 / 755
Referenced in: [show references]