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 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}
|
@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
|
Returns a datum by stripping the lexical information, source-location
|
||||||
information, properties, and certificates from @scheme[stx]. Inside of
|
information, properties, and certificates from @scheme[stx]. Inside of
|
||||||
pairs, (immutable) vectors, and (immutable) boxes, @tech{syntax object}s are
|
pairs, (immutable) vectors, (immutable) boxes, and immutable
|
||||||
recursively stripped.
|
@tech{prefab} structures, @tech{syntax object}s are recursively
|
||||||
|
stripped.
|
||||||
|
|
||||||
The stripping operation does not mutate @scheme[stx]; it creates new
|
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.}
|
source-location information recursively.}
|
||||||
|
|
||||||
@defproc[(datum->syntax [ctxt (or/c syntax? false/c)]
|
@defproc[(datum->syntax [ctxt (or/c syntax? false/c)]
|
||||||
|
@ -155,12 +158,13 @@ source-location information recursively.}
|
||||||
syntax?]{
|
syntax?]{
|
||||||
|
|
||||||
Converts the @tech{datum} @scheme[v] to a @tech{syntax object}. If
|
Converts the @tech{datum} @scheme[v] to a @tech{syntax object}. If
|
||||||
@scheme[v] is a pair, vector, or box, then the contents are
|
@scheme[v] is a pair, vector, box, or immutable @tech{prefab}
|
||||||
recursively converted; mutable vectors and boxes are essentially
|
structure, then the contents are recursively converted; mutable
|
||||||
replaced by immutable vectors and boxes. @tech{Syntax object}s already in
|
vectors and boxes are essentially replaced by immutable vectors and
|
||||||
@scheme[v] are preserved as-is in the result. For any kind of value
|
boxes. @tech{Syntax object}s already in @scheme[v] are preserved as-is
|
||||||
other than a pair, vector, box, or @tech{syntax object}, conversion means
|
in the result. For any kind of value other than a pair, vector, box,
|
||||||
wrapping the value with lexical information, source-location
|
immutable @tech{prefab} structure, or @tech{syntax object}, conversion
|
||||||
|
means wrapping the value with lexical information, source-location
|
||||||
information, properties, and certificates.
|
information, properties, and certificates.
|
||||||
|
|
||||||
Converted objects in @scheme[v] are given the lexical context
|
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
|
the resulting immediate @tech{syntax object} is given the properties (see
|
||||||
@secref["stxprops"]) of @scheme[prop] and the @tech{inactive
|
@secref["stxprops"]) of @scheme[prop] and the @tech{inactive
|
||||||
certificates} (see @secref["stxcerts"]) of @scheme[cert]; if
|
certificates} (see @secref["stxcerts"]) of @scheme[cert]; if
|
||||||
@scheme[v] is a pair, vector, or box, recursively converted values are
|
@scheme[v] is a pair, vector, box, or immutable @tech{prefab} structure,
|
||||||
not given properties or certificates.
|
recursively converted values are not given properties or certificates.
|
||||||
|
|
||||||
Any of @scheme[ctxt], @scheme[srcloc], @scheme[prop], or @scheme[cert]
|
Any of @scheme[ctxt], @scheme[srcloc], @scheme[prop], or @scheme[cert]
|
||||||
can be @scheme[#f], in which case the resulting syntax has no lexical
|
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
|
Graph structure is not preserved by the conversion of @scheme[v] to a
|
||||||
@tech{syntax object}. Instead, @scheme[v] is essentially unfolded into a
|
@tech{syntax object}. Instead, @scheme[v] is essentially unfolded into a
|
||||||
tree. If @scheme[v] has a cycle through pairs, vectors, and boxes,
|
tree. If @scheme[v] has a cycle through pairs, vectors, boxes, and immutable
|
||||||
then the @exnraise[exn:fail:contract].}
|
@tech{prefab} structures, then the @exnraise[exn:fail:contract].}
|
||||||
|
|
||||||
@defproc[(identifier? [v any/c]) boolean?]{
|
@defproc[(identifier? [v any/c]) boolean?]{
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user