On Sex, 2009-11-13 at 10:27 +0100, Adam Majewski wrote:
> When I use Lisp command :
> (format st "/* XPM */~%static char *mandelbrot[] = {~%")
>
> ( it is from file : complex_dynamics.lisp)
>
> Emacs gives :
> EVAL: variable ST has no value
> [Condition of type SYSTEM::SIM
>
> What means st here ?
> It is not a part of Lisp ?
Hi Adam,
it is nice to see that you are studying how the dynamics package works.
Your experience with dynamical systems can be very useful to improve
that package.
In this case st is just a name. I could have used "filestream" or
anything else. The format command expects "st" to refer to a "stream" (a
handler for an open file) where the result of the format command will be
sent.
Notice that before that line in complex_dynamics.lisp there is a command
that opens that stream:
(with-open-file (st file :direction :output :if-exists :supersede)
If you just want to experiment without using any files, you can save the
output of format into a variable with something such as:
(setf xpm-contents (format nil "/* XPM */~%static char *mandelbrot[] =
{~%"))
If you want to learn more about the format function, I recommend:
http://www.gigamonkeys.com/book/a-few-format-recipes.html
(that whole book is a good resource to learn Common Lisp)
Cheers,
Jaime