Commits

Moritz Heidkamp committed 75ab4a2

Even more docs

  • Participants
  • Parent commits 5af7dff

Comments (0)

Files changed (1)

File plan-impl.scm

   dependencies. In the latter case, dependencies are realized
   before their results are passed as arguments to {{proc}} in the
   order they are specified."
-    (@to "plan"))
+    (@to "plan")
+    (@no-source))
   (void))
 
 (define (plan-steps plan)
   @("Returns a {{plan}}'s list of steps as passed to [[#make-plan|{{make-plan}}]]."
-    (@to "(<step> ...)"))
+    (@to "(<step> ...)")
+    (@no-source))
   (void))
 
 (define (plan? datum)
   @("Checks whether {{datum}} is a plan."
-    (@to "boolean"))
+    (@to "boolean")
+    (@no-source))
   (void))
 
 (define-record plan steps)
 symbols. For dependent steps, those names are then lexically bound
 when {{expression ...}} is evaluated upon realization."
     (step "A step")
-    (... "More steps"))
+    (... "More steps")
+    (@no-source))
   (syntax-rules ()
     ((_ step ...)
      (make-plan (plan* step ...)))))
 whatever is returned by this realization's {{realize-step}}. It is
 expected to return the step's result value and may be called multiple
 times.")
-    (@to "plan-realization"))
+    (@to "plan-realization")
+    (@no-source))
   (void))
 
 (define-record plan-realization
   realize-step step-result)
 
 (define plan-realization-sequential
-  @("A sequential plan realization which realizes a plan one step after another.")
+  @("A sequential plan realization which realizes a plan one step after another."
+    (@no-source))
   (make-plan-realization force force))
 
 (define plan-realization
   @("The current plan realization strategy to be used by
-[[#realize-plan|realize-plan]]. The default value is [[#plan-realization-sequential|{{plan-realization-sequential}}]] See
+[[#realize-plan|realize-plan]]. The default value is
+[[#plan-realization-sequential|{{plan-realization-sequential}}]]. See
 [[#make-plan-realization|make-plan-realization]] on how to construct a
-custom plan-realization.")
+custom plan realization."
+    (@no-source))
   (make-parameter
    plan-realization-sequential))
 
 (define (realize-plan plan . args)
   @("Realizes the given plan using the current [[#plan-realization|{{plan-realization}}]]."
     (plan "The plan to realize")
-    (args "Optional arguments of the following structure:
-
-  (<to-realize> [<return-all-realized-results?>] <input> ... [keyword value] ...)
+    (args "Optional arguments of the following structure:")
+    "  (<to-realize> [<return-all-realized-results?>] <input> ... [keyword value] ...)
 
 ; to-realize : A step name or a list of step names to be realized. When given, only those steps and their dependencies will be realized.
 ; return-all-realized-results? : If the second optional argument is {{#t}} then, no matter what is passed as {{to-realize}}, the whole result map will be returned.
 ; input ... : Zero or more alists with keys being step names and values being constant results. Later alists override previous ones.
 ; keyword value : Zero or more keyword/value pairs. The keyword will be turned in to symbols and used as step names with their respective values as results.
-")
-    (@to "result"))
+"
+    (@to "result")
+    (@no-source))
   (receive (to-realize inputs return-all-realized-results?)
       (destructure-realization-args args)
     (let* ((steps (append inputs (plan-steps plan)))
              (result-ref to-realize results))))))
 
 (define (merge-plans . plans)
+  @("Merges the given {{plans}} from right to left."
+    (@to "plan")
+    (@no-source))
   (make-plan (append-map plan-steps (reverse plans))))
 
 (define-syntax plan-let
+  @("A form for defining and immediately realizing a plan,
+binding local variables for each step result."
+    (steps "A list of steps in the same format as accepted by the [[#plan|{{plan}}]] form.")
+    (body... "The body in which the results of realized steps are bound.")
+    (@to "value of last body expression")
+    (@no-source))
   (syntax-rules ()
     ((_ ((step value ...) ...) body ...)
      (match-let
        body ...))))
 
 (define (write-plan-dot plan #!optional (out (current-output-port)) (name "plan"))
+  @("Writes a Graphviz {{DOT}} representation of {{plan}} to the given {{out}} port."
+    (@no-source))
   (fprintf out "digraph ~S {~%" name)
   (for-each (lambda (step)
               (let ((name (symbol->string (car step))))
                 (for-each (lambda (dep)
                             (fprintf out " ~S -> ~S;~%" (symbol->string dep) name)) ;
-                            (or (cadr step) '()))))
+                          (or (cadr step) '()))))
             (plan-steps plan))
   (fprintf out "}~%"))