What you're looking at is the definition of a :before
auxiliary method. When the method update
is called with arguments that satisfy the types agent
and update
, this piece of code will run before the main method body. It's also possible to define :after
and :around
auxiliaries. Have a look at this PCL chapter for more information.
As to the format
string, I assume that's mistranscribed. The form you've got there will just issue a warning that you're passing it too many format arguments. I think what's meant is
(format t ":BEFORE completed for agent ~a and event ~a~%" a e)
which will print ":BEFORE completed for agent "
followed by the value of a
, followed by " and event "
followed by the value of e
, followed by a newline, to the stream *standard-output*
. For more information on CL's format
directives, take a look at this other PCL chapter, and possibly also this section of the CLHS