-(defstruct turtle who color heading xcor ycor (label "") (label-color 9.9d0) (size 1d0) shape)
-(defstruct patch color xcor ycor)
+(define-condition stop nil nil)
+(define-condition death nil nil)
+
+(defmacro with-stop-handler (&rest forms)
+ "MACRO WITH-STOP-HANDLER &rest FORMS => HANDLED-FORM
+
+ARGUMENTS AND VALUES:
+
+ FORMS: body to be handled
+ HANDLED-FORM: body with handling
+
+DESCRIPTION:
+
+ WITH-STOP-HANDLER is a convenience macro to handle when
+ programs issue a stop condition. When one does, a simple
+ :stop is returned."
+ `(handler-case (progn ,@forms) (stop (s) (declare (ignore s)) :stop)))
+
+(defmacro with-stop-and-death-handler (&rest forms)
+ `(handler-case
+ (progn ,@forms)
+ (stop (s) (declare (ignore s)) :stop)
+ (death (d) (declare (ignore d)) :death)))
+
+(defmacro defcommand (name args docstring &rest body)
+ `(defun ,name ,args ,docstring ,@body :undefined))
+
+(defstruct turtle who breed color heading xcor ycor (label "") label-color size shape own-vars)
+(defstruct patch color xcor ycor own-vars turtles)