How specify a parameter in a FORMAT control-string on Common Lisp as variable?

By Manoel Machado

What I can done:

CL-USER> (format nil "~10:<foobar~>")
"    foobar"

But I want pass 10 as parameter like:

CL-USER> (format nil "~d:<foobar~>" 10) ;; but throws error
"    foobar"

Exists any way to do that? Because I don’t wants do that:

CL-USER> (format nil (format nil "~~~d:<foobar~~>" 10))
"    foobar"

In Python or C is possible passing variable parameters to control-string using *, like this:

print("%*s" % (10, "foobar"))

I wants just the same in Common Lisp format. Thanks in advance.

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273