segs by test

(use srfi-13)(define (i x)(if (null? x)'(())(cons '() (map (pa$ cons (car x)) (i (cdr x))))))(define (t x)(if (null? x)'(())(cons x (t (cdr x)))))(define (segs x)(apply append (map (compose reverse cdr i) (t x))))(map (compose print (pa$ apply string)) (reverse (segs (string->list (read-line)))))

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page