WJ
unread,Nov 16, 2012, 1:27:46 PM11/16/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Thomas A. Russ wrote:
> > > Example, I want to print a list of numbers seperated by commas except
> > > at the last one which should end with a period and newline.
> >
> > I'd use FORMAT for this particular case:
> >
> > (format t "~&~{~#[~;~D.~:;~D,~]~}~%" '(1 2 3 4))
>
> There is an even simpler format form:
>
> (format t "~&~{~D~^, ~}.~%" '(1 2 3 4))
Clojure:
(clojure.pprint/cl-format nil "~&~{~D~^, ~}.~%" '(1 2 3 4))
1, 2, 3, 4.
Racket
(~a (apply ~a #:separator ", " '(2 3 4)) ".")
"2, 3, 4."