[racket] Splicing format string?

From: J. Ian Johnson (ianj at ccs.neu.edu)
Date: Thu Sep 1 09:43:41 EDT 2011

I have a list of symbols '(a b c) that I want to be printed "a b c" as part of string I'm formatting. Instead of writing
[assume the list is bound to syms]

(format "~a" (string-join (map symbol->string syms) " "))

I'd much rather write something like

(format "~@a" syms)

And have format do this for me.

1) Would other people also like this as part of format strings?
2) Is there a better way to write my first attempt without changing format string?

-Ian


Posted on the users mailing list.