Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
tutorials:beginner:high_level_plans [2022/03/15 13:27] – [Defining inference rules for designators] schimpftutorials:beginner:high_level_plans [2022/03/15 13:29] (current) – [Writing the plans] schimpf
Line 176: Line 176:
 (in-package :tut) (in-package :tut)
  
-(defun draw-house ()+(defun draw-house (&key ((:shape ?shape)) 
 +                   &allow-other-keys) 
 +  (declare (type (or keyword) ?shape))
   (with-fields (x y)   (with-fields (x y)
       (value *turtle-pose*)       (value *turtle-pose*)
Line 187: Line 189:
     (exe:perform (an action (type drawing) (shape triangle) (base-width 5) (height 4)))))     (exe:perform (an action (type drawing) (shape triangle) (base-width 5) (height 4)))))
  
-(defun draw-simple-shape (vertices)+(defun draw-simple-shape (&key 
 +                            ((:vertices ?vertices)) 
 +                          &allow-other-keys) 
 +  (declare (type (or list null) ?vertices)
   (mapcar   (mapcar
    (lambda (?v)    (lambda (?v)
      (exe:perform (an action (type navigating) (target ?v))))      (exe:perform (an action (type navigating) (target ?v))))
-   vertices))+   ?vertices)) 
  
 (defun navigate-without-pen (?target) (defun navigate-without-pen (?target)
Line 198: Line 204:
   (exe:perform (a motion (type setting-pen) (off 0))))   (exe:perform (a motion (type setting-pen) (off 0))))
  
-(defun navigate (?v+(defun navigate (&key ((:target ?target)) 
-  (exe:perform (a motion (type moving) (goal ?v))))+                 &allow-other-keys) 
 +  (declare (type (or list null) ?target)
 +  (exe:perform (a motion (type moving) (goal ?target))))
 </code> </code>