On this page:
top
up

3.21Syntax Quoting: quote-syntax πŸ”— i

syntax

(quote-syntax datum)

(quote-syntax datum#:local)
Similar to quote , but produces a syntax object that preserves the lexical information and source-location information attached to datum at expansion time.

When #:local is specified, then all scopes in the syntax object’s lexical information are preserved. When #:local is omitted, then the scope sets within datum are pruned to omit the scope for any binding form that appears between the quote-syntax form and the enclosing top-level context, module body, or phase level crossing, whichever is closer.

Unlike syntax (#'), quote-syntax does not substitute pattern variables bound by with-syntax , syntax-parse , or syntax-case .

Examples:

#t

> (quote-syntax (123))

#<syntax:eval:78:0 (1 2 3)>

> (with-syntax ([a#'5])
(quote-syntax (abc)))

#<syntax:eval:79:0 (a b c)>

#t

> (free-identifier=? (let ([x1])(quote-syntax x#:local))

#f

Changed in version 6.3 of package base: Added scope pruning and support for #:local.

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /