Proquint! added by sytse on Fri Jun 22 21:41:28 2018

(use (srfi 141))

(define (ip a b c d)
  (+ d (* #x100 (+ c (* #x100 (+ b (* #x100 a)))))))

(define (proquint number)
  (let* ((fn (lambda (chars)
               (let ((modulus (string-length chars)))
                 (lambda (k)
                   (lambda (in out)
                     (let-values (((quo idx) (truncate/ in modulus)))
                       (k quo (cons (string-ref chars idx) out))))))))
          (consonant (fn "bdfghjklmnprstvz"))
          (vowel     (fn "aiou")))
    (let loop ((number number)
               (out '()))
      (let* ((do-rest
               (lambda (in out)
                 (if (zero? in)
                     (list->string out)
                     (loop in (cons #\- out)))))
             (do-word
               (consonant (vowel (consonant (vowel (consonant do-rest)))))))
        (do-word number out)))))

(list (proquint (ip 127   0   0   1))
      (proquint (ip  63  84 220 193))
      (proquint (ip  63 118   7  35)))
;; => ("lusab-babad"
;;     "gutih-tugad"
;;     "gutuk-bisog")