fork download
  1. ; leftpad
  2.  
  3. (define (leftpad str len ch)
  4. (let loop ((n (- len (string-length str)))
  5. (prefix (list)))
  6. (if (positive? n)
  7. (loop (- n 1) (cons ch prefix))
  8. (string-append (list->string prefix) str))))
  9.  
  10. (display (leftpad "hello" 7 #\@)) (newline)
Success #stdin #stdout 0.03s 8656KB
stdin
Standard input is empty
stdout
@@hello