Robin Lee Powell schrieb:
> Someone *must* have written this. Probably lots of someones. May I
> have your code?
>
> The problem is (very) simple. I have:
>
> (("foo" "1" "bar") ("baz" "baaaaaaaaz" "2"))
>
> I wish to output (something like):
>
> foo 1 bar
> baz baaaaaaaaz 2
>
> That is, given a list of lists of strings and a given screen width,
> pad the strings appropriately and join them, returning a list of
> strings.
>
> -Robin
>
>
As the others allready suggested the fmt egg does this
and many things more.
Here is how it might look like:
(use fmt)
(define (list->columnar-string ls)
(with-output-to-string (lambda ()
(fmt #t (apply columnar (map dsp ls)))))
(list->columnar-string '("foo" "frooble" "bar"))
greets david
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users