; leftpad
(define (leftpad str len ch)
(let loop ((n (- len (string-length str)))
(prefix (list)))
(if (positive? n)
(loop (- n 1) (cons ch prefix))
(string-append (list->string prefix) str))))
(display (leftpad "hello" 7 #\@)) (newline)
OyBsZWZ0cGFkCgooZGVmaW5lIChsZWZ0cGFkIHN0ciBsZW4gY2gpCiAgKGxldCBsb29wICgobiAoLSBsZW4gKHN0cmluZy1sZW5ndGggc3RyKSkpCiAgICAgICAgICAgICAocHJlZml4IChsaXN0KSkpCiAgICAoaWYgKHBvc2l0aXZlPyBuKQogICAgICAgIChsb29wICgtIG4gMSkgKGNvbnMgY2ggcHJlZml4KSkKICAgICAgICAoc3RyaW5nLWFwcGVuZCAobGlzdC0+c3RyaW5nIHByZWZpeCkgc3RyKSkpKQoKKGRpc3BsYXkgKGxlZnRwYWQgImhlbGxvIiA3ICNcQCkpIChuZXdsaW5lKQ==