Created
January 23, 2016 03:20
-
-
Save eshamster/f52f2835db57bc38e022 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun replace-dot-in-tree (tree) | |
(labels ((rec (rest) | |
(cond | |
((consp rest) (let (result) | |
(dolist-with-left (elem left rest) | |
(push (rec elem) result)) | |
(nreverse result))) | |
(rest (replace-dot-sep rest))))) | |
(rec tree))) | |
"Example: | |
CL-USER> (defparameter x '(1 2 3 4 5)) | |
X | |
CL-USER> (ps-experiment.base::dolist-with-left (var left x) | |
(print var) | |
(print left)) | |
1 | |
NIL | |
2 | |
(1 2 3 4 5) | |
3 | |
(2 3 4 5) | |
4 | |
(3 4 5) | |
5 | |
(4 5) | |
NIL | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment