Hi,
Is there a way to direct the format function to use a single value
repeatedly for several positional parameters?
Here's the specific example of what I mean. In my .emacs, the
following string is used:
"/home/amax/opt/scmutils/mit-scheme/bin/scheme --band
/home/amax/opt/scmutils/mit-scheme/lib/edwin-mechanics.com --heap 6000 --library
/home/amax/opt/scmutils/mit-scheme/lib"
(See [1] if you're curious what it's for.) The substring
"/home/amax/opt/scmutils/mit-scheme" repeats 3 times. The idea I had is to use
a format string like:
(format "%s/bin/scheme --band %s/lib/edwin-mechanics.com --heap 6000 --library
%s/lib" ...(something)...)
... and to do this in a way that I only had to type that substring
once. However, I did not find a way to do this directly. The closest
thing I came up with is this:
(apply 'format
(cons "%s/bin/scheme --band %s/lib/edwin-mechanics.com --heap 6000 --library %s/lib"
(make-list 3 "/home/amax/opt/scmutils/mit-scheme")))
Is there a clearer way to do this?