Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorials:beginner:failure_handling [2019/07/16 11:34] cpotutorials:beginner:failure_handling [2022/03/15 13:36] – [Defining and signaling a failure condition] schimpf
Line 107: Line 107:
 (defparameter *max-bound* 10.5) (defparameter *max-bound* 10.5)
  
-(defun navigate (?v)+(defun navigate (&key ((:target ?target)) 
 +                 &allow-other-keys) 
 +  (declare (type (or list null) ?target))
   (flet ((out-of-bounds (pose)   (flet ((out-of-bounds (pose)
            (with-fields (x y)            (with-fields (x y)
Line 116: Line 118:
       (whenever ((fl-funcall #'out-of-bounds *turtle-pose*))       (whenever ((fl-funcall #'out-of-bounds *turtle-pose*))
         (error 'out-of-bounds-error))         (error 'out-of-bounds-error))
-      (exe:perform (a motion (type moving) (goal ?v))))))+      (exe:perform (a motion (type moving) (goal ?target))))))
 </code> </code>