Fixup documentation internal linking.

This commit is contained in:
Tony Garnock-Jones 2013-05-29 17:23:52 -04:00
parent d2ba5c65a9
commit 8e2b9d72e5
7 changed files with 92 additions and 25 deletions

View File

@ -67,7 +67,7 @@ handler, then, has the following approximate type:
@centered{@italic{State} × @italic{Event} → @italic{State} × (Listof @italic{Action})} @centered{@italic{State} × @italic{Event} → @italic{State} × (Listof @italic{Action})}
Event handlers are registered with the VM by creating @tech{endpoints} Event handlers are registered with the VM by creating @tech{endpoints}
using the @racket[endpoint] macro (described in @secref{Actions}) or using the @racket[endpoint] macro (described in @secref{endpoint-dsl}) or
the low-level @racket[add-endpoint] structure (described in the low-level @racket[add-endpoint] structure (described in
@secref{endpoints-and-messages}). @secref{endpoints-and-messages}).
@ -141,6 +141,8 @@ Roles have three parts:
@section[#:tag "messages-and-topics"]{Messages and Topics} @section[#:tag "messages-and-topics"]{Messages and Topics}
@declare-exporting[marketplace]
@deftech{Messages} are simply Racket data structures. They can be any @deftech{Messages} are simply Racket data structures. They can be any
value for which @racket[equal?] is defined, any @racket[#:prefab] value for which @racket[equal?] is defined, any @racket[#:prefab]
structure, most @racket[#:transparent] structures, or any non-object structure, most @racket[#:transparent] structures, or any non-object

View File

@ -2,6 +2,9 @@
@require[racket/include] @require[racket/include]
@include{prelude.inc} @include{prelude.inc}
@require[(for-label marketplace/drivers/event-relay
marketplace/drivers/tcp-bare)]
@title{Drivers} @title{Drivers}
@section{event-relay} @section{event-relay}
@ -44,6 +47,12 @@ with a running @racket[event-relay].
} }
@defthing[tcp Spawn]{
A pre-made @racket[spawn] action equivalent to @racket[(tcp-driver)].
}
} }
@subsection{TCP channels} @subsection{TCP channels}

View File

@ -0,0 +1,12 @@
#lang racket/base
;; Provides |from|, useful for importing identifiers from non-default
;; contexts without spelling them differently.
(require scribble/decode)
(provide from)
(define-syntax-rule (from require-spec pre-content ...)
(let ()
(local-require require-spec)
(splice (list pre-content ...))))

View File

@ -2,14 +2,16 @@
@require[racket/include] @require[racket/include]
@include{prelude.inc} @include{prelude.inc}
@require[(for-label (except-in "../sugar-untyped.rkt" @require[(for-label (except-in marketplace/sugar-untyped transition/no-state)
transition/no-state) (only-in marketplace/drivers/tcp-bare tcp)
(only-in "../drivers/tcp-bare.rkt" tcp) (except-in marketplace/sugar-typed ?))]
(except-in "../sugar-typed.rkt"
?))]
@title[#:tag "high-level-interface"]{High-level interface} @title[#:tag "high-level-interface"]{High-level interface}
@declare-exporting[#:use-sources (marketplace/sugar-values
marketplace/sugar-untyped
marketplace/sugar-typed)]
This high-level interface between a VM and a process is analogous to This high-level interface between a VM and a process is analogous to
the @emph{C library interface} of a Unix-like operating system. The the @emph{C library interface} of a Unix-like operating system. The
@secref{low-level-interface} corresponds to the @emph{system call @secref{low-level-interface} corresponds to the @emph{system call
@ -63,7 +65,10 @@ and @racket[ground-vm:] explicitly.
@section{Using Marketplace as a library} @section{Using Marketplace as a library}
@defmodule*[(marketplace/sugar-untyped @defmodule*[(marketplace/sugar-untyped
marketplace/sugar-typed)] marketplace/sugar-typed)
#:use-sources (marketplace/sugar-values
marketplace/sugar-untyped
marketplace/sugar-typed)]
Instead of using Racket's @tt{#lang} feature, ordinary Racket programs Instead of using Racket's @tt{#lang} feature, ordinary Racket programs
can use Marketplace features by requiring Marketplace modules can use Marketplace features by requiring Marketplace modules
@ -109,6 +114,11 @@ its state type).
@section[#:tag "constructing-transitions"]{Constructing transitions} @section[#:tag "constructing-transitions"]{Constructing transitions}
@declare-exporting[#:use-sources (marketplace
marketplace/sugar-values
marketplace/sugar-untyped
marketplace/sugar-typed)]
@deftogether[( @deftogether[(
@defform[(transition new-state action-tree ...)] @defform[(transition new-state action-tree ...)]
@defform[(transition: new-state : State action-tree ...)] @defform[(transition: new-state : State action-tree ...)]
@ -484,10 +494,10 @@ to the orientation of the current endpoint) or
@defproc[(delete-endpoint [id Any] [reason Any #f]) Action]{ @defproc[(delete-endpoint [id Any] [reason Any #f]) Action]{
Use this action to delete a previously-added endpoint by name. The Use this action to delete a previously-added endpoint by name. The
@racket[delete-endpoint-id] must be @racket[equal?] to the @racket[id] given must be @racket[equal?] to the corresponding
corresponding @racket[add-endpoint-pre-eid]; when @racket[endpoint] @racket[add-endpoint-pre-eid]; when @racket[endpoint] was used to
was used to construct the endpoint to be deleted, the relevant name is construct the endpoint to be deleted, the relevant name is that bound
that bound by @racket[#:let-name] or supplied to @racket[#:name]. See by @racket[#:let-name] or supplied to @racket[#:name]. See
@secref{naming-endpoints}. @secref{naming-endpoints}.
If @racket[reason] is supplied, it is included in the corresponding If @racket[reason] is supplied, it is included in the corresponding

View File

@ -2,8 +2,6 @@
@require[racket/include] @require[racket/include]
@include{prelude.inc} @include{prelude.inc}
@require[(for-label "../main.rkt")]
@title[#:tag "low-level-interface"]{Low-level interface} @title[#:tag "low-level-interface"]{Low-level interface}
@defmodule[marketplace] @defmodule[marketplace]
@ -41,19 +39,30 @@ Typed Racket types capturing various notions of handler function.
} }
@section{Topics and Roles} @section{Messages, Topics and Roles}
@deftype[Topic Any]{ @declare-exporting[marketplace marketplace/sugar-untyped marketplace/sugar-typed
#:use-sources (marketplace marketplace/sugar-untyped marketplace/sugar-typed)]
As previously mentioned, @tech{topics} are ordinary Racket values @deftogether[(
which may have embedded wildcards. @deftype[Message Any]
@deftype[Topic Any]
)]{
As previously mentioned, @tech{messages} are ordinary Racket values,
and @tech{topics} are ordinary Racket values which may have embedded
wildcards.
} }
@defthing[? Topic]{ @deftogether[(
@defproc[(wild) Topic]
@defthing[#:kind "syntax" ? Topic]
)]{
Each time @racket[?] is used in an expression context, it produces a Each time @racket[?] (or @racket[(wild)]) is used in an expression
fresh topic wildcard, suitable for use in a topic pattern. context, it produces a fresh topic wildcard, suitable for use in a
topic pattern.
} }
@ -170,9 +179,17 @@ handler's @tech{endpoint}.
@section{Actions} @section{Actions}
@declare-exporting[marketplace]
@deftogether[( @deftogether[(
@deftype[(Action State) (U (PreAction State) (yield State) (at-meta-level State))] @deftype[(Action State) (U (PreAction State)
@deftype[(PreAction State) (U (add-endpoint State) delete-endpoint send-message (spawn State) quit)] (yield State)
(at-meta-level State))]
@deftype[(PreAction State) (U (add-endpoint State)
delete-endpoint
send-message
(spawn State)
quit)]
)]{ )]{
Actions are requests from a process to its containing VM. If wrapped Actions are requests from a process to its containing VM. If wrapped
@ -237,7 +254,9 @@ Deletes an existing endpoint named @racket[pre-eid]. The given
@racket[absence-event]. @racket[absence-event].
If no specific reason is needed, it is conventional to supply If no specific reason is needed, it is conventional to supply
@racket[#f] as the @racket[delete-endpoint-reason]. @racket[#f] as the @racket[delete-endpoint-reason]. See also the
convenience @from[marketplace/sugar-values]{@racket[delete-endpoint]}
function from @racket[marketplace/sugar-values].
} }
@ -250,8 +269,10 @@ Sends a message to peers.@note{Or, if @racket[at-meta-level], peers of
the containing VM.} The given @racket[Orientation] should describe the the containing VM.} The given @racket[Orientation] should describe the
role the sender is playing when sending this message: usually, it will role the sender is playing when sending this message: usually, it will
be @racket['publisher], but when the message is @emph{feedback} for be @racket['publisher], but when the message is @emph{feedback} for
some publisher, it will be @racket['subscriber]. See also some publisher, it will be @racket['subscriber].
@racket[send-feedback]. @from[marketplace/sugar-values]{See also the @racket[send-message] and
@racket[send-feedback] convenience functions from
@racket[marketplace/sugar-values].}
} }

View File

@ -2,6 +2,13 @@
@require[racket/include] @require[racket/include]
@include{prelude.inc} @include{prelude.inc}
@require[(for-label marketplace/support/spy
marketplace/support/debug
marketplace/log-untyped
(except-in marketplace/log-typed
matrix-log
matrix-root-logger))]
@title{Management and Monitoring} @title{Management and Monitoring}
@section{generic-spy} @section{generic-spy}

View File

@ -6,9 +6,15 @@
slideshow/pict slideshow/pict
"vm-pictures.rkt" "vm-pictures.rkt"
"from.rkt"
(for-syntax racket) (for-syntax racket)
(for-label typed/racket/base)) (for-label typed/racket/base))
(require (for-label (except-in marketplace/sugar-untyped transition/no-state)
(only-in marketplace/drivers/tcp-bare tcp)
(except-in marketplace/sugar-typed ?)))
;; TODO: make it display "=" instead of ":" connecting the defined ;; TODO: make it display "=" instead of ":" connecting the defined
;; type to the definition. ;; type to the definition.
(define-syntax deftype (define-syntax deftype