The (hidden) property to represent original syntax is dropped for a syntax object that is marshaled as part of compiled code; see also current-compile.
(syntax-source-module stx [source?])
→ (or/c module-path-index? symbol? path? resolved-module-path? #f) stx : syntax? source? : any/c = #f
a syntax pair (described below)
the empty list
an immutable vector containing syntax objects
an immutable box containing syntax objects
A syntax pair is a pair containing a syntax object as its first element, and either the empty list, a syntax pair, or a syntax object as its second element.
A syntax object that is the result of read-syntax reflects the use of delimited . in the input by creating a syntax object for every pair of parentheses in the source, and by creating a pair-valued syntax object only for parentheses in the source. See Reading Pairs and Lists for more information.
If stx is tainted or armed, then any syntax object in the result of (syntax-e stx) is tainted, and multiple calls to syntax-e may return values that are not eq?. For a stx that is not armed, the results from multiple calls to syntax-e of stx are eq?.
The stripping operation does not mutate stx; it creates new pairs, vectors, boxes, hash tables, and prefab structures as needed to strip lexical and source-location information recursively.
ctxt : (or/c syntax? #f) v : any/c
(or/c syntax? #f (list/c any/c (or/c exact-positive-integer? #f) (or/c exact-nonnegative-integer? #f) (or/c exact-positive-integer? #f) (or/c exact-nonnegative-integer? #f)) (vector/c any/c (or/c exact-positive-integer? #f) (or/c exact-nonnegative-integer? #f) (or/c exact-positive-integer? #f) (or/c exact-nonnegative-integer? #f))) = #f prop : (or/c syntax? #f) = #f ignored : (or/c syntax? #f) = #f
Converted objects in v are given the lexical context information of ctxt and the source-location information of srcloc. If v is not already a syntax object, then the resulting immediate syntax object is given the properties (see Syntax Object Properties) of prop (even the hidden ones that would not be visible via syntax-property-symbol-keys); if v is a pair, vector, box, immutable hash table, or immutable prefab structure, recursively converted values are not given properties. If ctxt is tainted or armed, then the resulting syntax object from datum->syntax is tainted.
Any of ctxt, srcloc, or prop can be #f, in which case the resulting syntax has no lexical context, source information, and/or new properties.
If srcloc is not #f or a syntax object, it must be a list or vector of five elements:
where source-name is an arbitrary value for the source name; line is an integer for the source line, or #f; column is an integer for the source column, or #f; position is an integer for the source position, or #f; and span is an integer for the source span, or #f. The line and column values must both be numbers or both be #f, otherwise the exn:fail:contract exception is raised.
Graph structure is not preserved by the conversion of v to a syntax object. Instead, v is essentially unfolded into a tree. If v has a cycle through pairs, vectors, boxes, immutable hash tables, and immutable prefab structures, then the exn:fail:contract exception is raised.
The ignored argument is allowed for backward compatibility and has no effect on the returned syntax object.
If v is a number, character, string, byte string, or regular expression, then the result is a value that is equal? to v and eq? to a potential result of the default reader. (Note that mutable strings and byte strings are interned as immutable strings and byte strings.)
If v1 and v2 are equal? but not
eq?, then it is possible that (datum-intern-literal v1) will return v1 and—
stx : syntax? shift : (or/c exact-integer? #f)
(identifier-prune-lexical-context id-stx [ syms]) → identifier? id-stx : identifier? syms : (listof symbol?) = (list (syntax-e id-stx))
See also quote-syntax/prune.
(syntax-recertify new-stx old-stx inspector key) → syntax? new-stx : syntax? old-stx : syntax? inspector : inspector? key : any/c
stx : syntax? phase : (or/c exact-integer? #f) = (syntax-local-phase-level) all-bindings? : any/c = #f
the result of (syntax-e stx), if it is a symbol.
a list of vectors, where each vector represents a scope attached to stx.
Each vector starts with a number that is distinct for every scope. A symbol afterward provides a hint at the scope’s origin: 'module for a module scope, 'macro for a macro-introduction scope, 'use-site for a macro use-site scope, or 'local for a local binding form. In the case of a 'module scope that corresponds to the inside edge, the module’s name and a phase (since an inside-edge scope is generated for each phase) are shown.
a list of bindings, each represented by a hash table. A binding table can include— but is not limited to— the following keys:
the symbolic name for the binding.
the scopes, as a list of vectors, for the binding.
a symbol representing a local binding; when this key is present, 'module is absent.
an encoding of a import from another module; when this key is present, 'local is absent.
a hash table of debugging information from an identifier for which the binding is an alias.
a list of hash tables like the one produced by syntax-debug-info for cross-namespace binding fallbacks.
Added in version 6.3 of package base.