fix docs to indicate that datum->syntax and syntax->datum recur through immutable prefab structures
svn: r11253
This commit is contained in:
parent
aeb26ea4d2
commit
32729b8ae8
|
@ -102,6 +102,8 @@ leaving nested syntax structure (if any) in place. The result of
|
|||
|
||||
@item{an immutable box containing @tech{syntax object}s}
|
||||
|
||||
@item{an immutable @tech{prefab} structure containing @tech{syntax object}s}
|
||||
|
||||
@item{some other kind of datum---usually a number, boolean, or string}
|
||||
|
||||
}
|
||||
|
@ -130,11 +132,12 @@ are flattened.}
|
|||
|
||||
Returns a datum by stripping the lexical information, source-location
|
||||
information, properties, and certificates from @scheme[stx]. Inside of
|
||||
pairs, (immutable) vectors, and (immutable) boxes, @tech{syntax object}s are
|
||||
recursively stripped.
|
||||
pairs, (immutable) vectors, (immutable) boxes, and immutable
|
||||
@tech{prefab} structures, @tech{syntax object}s are recursively
|
||||
stripped.
|
||||
|
||||
The stripping operation does not mutate @scheme[stx]; it creates new
|
||||
pairs, vectors, and boxes as needed to strip lexical and
|
||||
pairs, vectors, boxes, and @tech{prefab} structures as needed to strip lexical and
|
||||
source-location information recursively.}
|
||||
|
||||
@defproc[(datum->syntax [ctxt (or/c syntax? false/c)]
|
||||
|
@ -155,12 +158,13 @@ source-location information recursively.}
|
|||
syntax?]{
|
||||
|
||||
Converts the @tech{datum} @scheme[v] to a @tech{syntax object}. If
|
||||
@scheme[v] is a pair, vector, or box, then the contents are
|
||||
recursively converted; mutable vectors and boxes are essentially
|
||||
replaced by immutable vectors and boxes. @tech{Syntax object}s already in
|
||||
@scheme[v] are preserved as-is in the result. For any kind of value
|
||||
other than a pair, vector, box, or @tech{syntax object}, conversion means
|
||||
wrapping the value with lexical information, source-location
|
||||
@scheme[v] is a pair, vector, box, or immutable @tech{prefab}
|
||||
structure, then the contents are recursively converted; mutable
|
||||
vectors and boxes are essentially replaced by immutable vectors and
|
||||
boxes. @tech{Syntax object}s already in @scheme[v] are preserved as-is
|
||||
in the result. For any kind of value other than a pair, vector, box,
|
||||
immutable @tech{prefab} structure, or @tech{syntax object}, conversion
|
||||
means wrapping the value with lexical information, source-location
|
||||
information, properties, and certificates.
|
||||
|
||||
Converted objects in @scheme[v] are given the lexical context
|
||||
|
@ -169,8 +173,8 @@ information of @scheme[ctxt] and the source-location information of
|
|||
the resulting immediate @tech{syntax object} is given the properties (see
|
||||
@secref["stxprops"]) of @scheme[prop] and the @tech{inactive
|
||||
certificates} (see @secref["stxcerts"]) of @scheme[cert]; if
|
||||
@scheme[v] is a pair, vector, or box, recursively converted values are
|
||||
not given properties or certificates.
|
||||
@scheme[v] is a pair, vector, box, or immutable @tech{prefab} structure,
|
||||
recursively converted values are not given properties or certificates.
|
||||
|
||||
Any of @scheme[ctxt], @scheme[srcloc], @scheme[prop], or @scheme[cert]
|
||||
can be @scheme[#f], in which case the resulting syntax has no lexical
|
||||
|
@ -195,8 +199,8 @@ numbers or both be @scheme[#f], otherwise the
|
|||
|
||||
Graph structure is not preserved by the conversion of @scheme[v] to a
|
||||
@tech{syntax object}. Instead, @scheme[v] is essentially unfolded into a
|
||||
tree. If @scheme[v] has a cycle through pairs, vectors, and boxes,
|
||||
then the @exnraise[exn:fail:contract].}
|
||||
tree. If @scheme[v] has a cycle through pairs, vectors, boxes, and immutable
|
||||
@tech{prefab} structures, then the @exnraise[exn:fail:contract].}
|
||||
|
||||
@defproc[(identifier? [v any/c]) boolean?]{
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user