fork download
  1. ; removing spaces
  2.  
  3. (define (filter pred? xs)
  4. (let loop ((xs xs) (ys '()))
  5. (cond ((null? xs) (reverse ys))
  6. ((pred? (car xs))
  7. (loop (cdr xs) (cons (car xs) ys)))
  8. (else (loop (cdr xs) ys)))))
  9.  
  10. (define (complement f) (lambda xs (not (apply f xs))))
  11.  
  12. (define (left-section proc . args)
  13. (lambda xs (apply proc (append args xs))))
  14.  
  15. (define (del-char c str)
  16. (list->string
  17. (filter (complement (left-section char=? c))
  18. (string->list str))))
  19.  
  20. (display (del-char #\space "Programming Praxis")) (newline)
  21. (display (del-char #\r "Programming Praxis")) (newline)
Success #stdin #stdout 0s 7960KB
stdin
Standard input is empty
stdout
ProgrammingPraxis
Pogamming Paxis