Skip to content

Instantly share code, notes, and snippets.

@hchbaw
Last active July 8, 2017 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hchbaw/5106be739c86348a869ccfafc31a5b21 to your computer and use it in GitHub Desktop.
Save hchbaw/5106be739c86348a869ccfafc31a5b21 to your computer and use it in GitHub Desktop.
;; https://teratail.com/questions/83177
(use srfi-14 :only (char-set->list))
(define (pr xxs)
(define (stringify xxs listref)
(string-join (concatenate (map listref xxs)) " "))
(begin
($ print $ stringify xxs car)
($ print $ stringify xxs (cut list-ref <> 1 '()))))
(let ()
(define xs ($ map string $ sort $ char-set->list #[a-z]))
(define (slices~ n xs) (slices xs n))
(for-each pr ($ slices~ 4 $ slices~ 2 $ slices~ 2 xs)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment