aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColin Okay <cbeok@protonmail.com>2020-07-15 11:27:14 -0500
committerColin Okay <cbeok@protonmail.com>2020-07-15 11:27:14 -0500
commitce679bff109588dbceada4d880420aa68ee7bada (patch)
tree83626a803bd8bce32378b530d1004ab394ef4777
parent2622a909e9277ef1b3eaa193bd53ac5cab152a73 (diff)
simplified scramble
-rw-r--r--README.md6
-rw-r--r--examples.lisp7
2 files changed, 5 insertions, 8 deletions
diff --git a/README.md b/README.md
index 4f455f7..af0014a 100644
--- a/README.md
+++ b/README.md
@@ -96,10 +96,8 @@ example apears at the end of the document, following the tutorial.
> (defun scramble (n str)
(assert (< n (length str)))
(let ((str (pad str (* n (ceiling (/ (length str) n))))))
- (concatenate 'string
- (apply #'nconc
- (mapcar #'collect
- (disperse! n (seq str)))))))
+ (apply #'concatenate 'string
+ (mapcar #'collect (disperse! n (seq str))))))
> (defun descramble (n str)
(concatenate 'string
diff --git a/examples.lisp b/examples.lisp
index 33ae013..0a40a0c 100644
--- a/examples.lisp
+++ b/examples.lisp
@@ -131,10 +131,9 @@ vector VEC, one at a time."
(defun scramble (n str)
(assert (< n (length str)))
(let ((str (pad str (* n (ceiling (/ (length str) n))))))
- (concatenate 'string
- (apply #'nconc
- (mapcar #'collect
- (disperse! n (seq str)))))))
+ (apply #'concatenate 'string
+ (mapcar #'collect (disperse! n (seq str))))))
+
(defun chunk (n str)
(assert (zerop (mod (length str) n)))