October 9th Tuesday (十月 九日 火曜日)
来源:互联网 发布:中国从非洲进口数据 编辑:程序博客网 时间:2024/05/16 20:37
A syntax expression is similar to a quote expression except that (1)the values of pattern variables
appearing within <template> are inserted into template, (2) contextual information associated both with
the input and with the template is retained in the output to support lexical scoping, and (3) the value
of a syntax expression is a syntax object.
The value of a syntax form is a copy of <template> in which the pattern variables appearing within the
template are replaced with the input subforms to which they are bound. Pattern data and identifiers that
are not pattern variables or ellipses are copied directly into the output. A subtemplate followed by an
ellipsis into zero or more occurrences of the subtemplate.
(bound-identifier=? id1 id2)
Id1 and Id2 must be identifiers. The procedure bound-identifier=? returns #t if a binding for one would
capture a reference to the other in the output of the transformer, assuming that the reference appears
within the scope of the binding, and #f otherwise. In general, two identifiers are bound-identifier=?
only if both are introduced by the same transformer application. Operationally, two identifiers are
considered equivalent by bound-identifier=? if and only if they have the same name and same marks.
(free-identifier=? id1 id2)
Id1 and Id2 must be identifiers. The free-identifier=? procedure returns #t if and only if the two
identifiers would resolve to the same binding if both were to appear in the output of a transformer
outside of any bindings inserted by the transformer. (If neither of two like-named identifiers resolves
to a binding, i.e., both are unbound, they are considered to resolve to the same binding.) Operationally,
two identifiers are considered equivalent by free-identifier=? if and only the topmost matching substitution
for each maps to the same binding or the identifiers have the same name and no matching substitution.
(syntax->datum syntax-object)
Strips all syntactic information from a syntax object and returns the corresponding Scheme datum.
(datum->syntax template-id datum)
Template-id must be a template identifier and datum should be a datum value. The datum->syntax procedure
returns a syntax-object representation of datum that contains the same contextual information as template-id,
with the effect that the syntax object behaves as if it were introduced into the code when template-id was
introduced.
(with-syntax ((<pattern> <expression>) ...) <body>)
The with-syntax form is used to bind pattern variables, just as let is used to bind variables. This allows
a transformer to construct its output in separate pieces, then put the pieces together.
Each <pattern> is identical in form to a syntax-case pattern. The value of each <expression> is computed
and destructed according to the corresponding <pattern>, and pattern variables within the <pattern> are bound
as with syntax-case to the corresponding portions of the value within <body>.
(define-syntax with-syntax
(lambda (x)
(syntax-case x ()
((_ ((p e0) ...) e1 e2 ...)
(syntax (syntax-case (list e0 ...) ()
((p ...) (let () e1 e2 ...))))))))
October 10th Wednesday (十月 十日 水曜日)
(syntax datum) #'datum
(quasisyntax <template>) #`<template>
unsyntax #,<template>
unsyntax-splicing #,@<template>
The quasisyntax form is similar to syntax, but it allows parts of the quoted text to be evaluated, in a
manner similar to the operation of quasiquoted.
Within a quasisyntax template, subforms of unsyntax and unsyntax-splicing forms are evaluated, and every-
thing else is treated as ordinary template material, as with "syntax". The value of each unsyntax subform is
inserted into the output in place of the unsyntax form, while the value of each unsyntax-splicing subform is
spliced into the surrounding list or vector structure. Uses of unsyntax and unsyntax-splicing are vaild only
within quasisyntax expressions.
A quasisyntax expression may be nested, with each quasisyntax introducing a new level of syntax quotation
and each unsyntax or unsyntax-splicing taking away a level of quotation. An expression nested within n quasi-
syntax expressions must be within n unsyntax or unsyntax-splicing expressions to be evaluated.
Use of unsyntax and unsyntax-splicing with zero or more than one subform are vaild only in splicing (list or
vector) contexts. (unsyntax template ...) is equivalent to (unsyntax template) ..., and (unsyntax-splicing
template ...) is equivalent to (unsyntax-splicing template) ... . These forms are primarily useful as intermediate forms in the output of the quasisyntax expander.
appearing within <template> are inserted into template, (2) contextual information associated both with
the input and with the template is retained in the output to support lexical scoping, and (3) the value
of a syntax expression is a syntax object.
The value of a syntax form is a copy of <template> in which the pattern variables appearing within the
template are replaced with the input subforms to which they are bound. Pattern data and identifiers that
are not pattern variables or ellipses are copied directly into the output. A subtemplate followed by an
ellipsis into zero or more occurrences of the subtemplate.
(bound-identifier=? id1 id2)
Id1 and Id2 must be identifiers. The procedure bound-identifier=? returns #t if a binding for one would
capture a reference to the other in the output of the transformer, assuming that the reference appears
within the scope of the binding, and #f otherwise. In general, two identifiers are bound-identifier=?
only if both are introduced by the same transformer application. Operationally, two identifiers are
considered equivalent by bound-identifier=? if and only if they have the same name and same marks.
(free-identifier=? id1 id2)
Id1 and Id2 must be identifiers. The free-identifier=? procedure returns #t if and only if the two
identifiers would resolve to the same binding if both were to appear in the output of a transformer
outside of any bindings inserted by the transformer. (If neither of two like-named identifiers resolves
to a binding, i.e., both are unbound, they are considered to resolve to the same binding.) Operationally,
two identifiers are considered equivalent by free-identifier=? if and only the topmost matching substitution
for each maps to the same binding or the identifiers have the same name and no matching substitution.
(syntax->datum syntax-object)
Strips all syntactic information from a syntax object and returns the corresponding Scheme datum.
(datum->syntax template-id datum)
Template-id must be a template identifier and datum should be a datum value. The datum->syntax procedure
returns a syntax-object representation of datum that contains the same contextual information as template-id,
with the effect that the syntax object behaves as if it were introduced into the code when template-id was
introduced.
(with-syntax ((<pattern> <expression>) ...) <body>)
The with-syntax form is used to bind pattern variables, just as let is used to bind variables. This allows
a transformer to construct its output in separate pieces, then put the pieces together.
Each <pattern> is identical in form to a syntax-case pattern. The value of each <expression> is computed
and destructed according to the corresponding <pattern>, and pattern variables within the <pattern> are bound
as with syntax-case to the corresponding portions of the value within <body>.
(define-syntax with-syntax
(lambda (x)
(syntax-case x ()
((_ ((p e0) ...) e1 e2 ...)
(syntax (syntax-case (list e0 ...) ()
((p ...) (let () e1 e2 ...))))))))
October 10th Wednesday (十月 十日 水曜日)
(syntax datum) #'datum
(quasisyntax <template>) #`<template>
unsyntax #,<template>
unsyntax-splicing #,@<template>
The quasisyntax form is similar to syntax, but it allows parts of the quoted text to be evaluated, in a
manner similar to the operation of quasiquoted.
Within a quasisyntax template, subforms of unsyntax and unsyntax-splicing forms are evaluated, and every-
thing else is treated as ordinary template material, as with "syntax". The value of each unsyntax subform is
inserted into the output in place of the unsyntax form, while the value of each unsyntax-splicing subform is
spliced into the surrounding list or vector structure. Uses of unsyntax and unsyntax-splicing are vaild only
within quasisyntax expressions.
A quasisyntax expression may be nested, with each quasisyntax introducing a new level of syntax quotation
and each unsyntax or unsyntax-splicing taking away a level of quotation. An expression nested within n quasi-
syntax expressions must be within n unsyntax or unsyntax-splicing expressions to be evaluated.
Use of unsyntax and unsyntax-splicing with zero or more than one subform are vaild only in splicing (list or
vector) contexts. (unsyntax template ...) is equivalent to (unsyntax template) ..., and (unsyntax-splicing
template ...) is equivalent to (unsyntax-splicing template) ... . These forms are primarily useful as intermediate forms in the output of the quasisyntax expander.
- October 9th Tuesday (十月 九日 火曜日)
- October 23th Tuesday (十月 二十三日 火曜日)
- 2008 October 9th Thursday (十月 九日 木曜日)
- 2008 October 7th Tuesday (十月 七日 火曜日)
- 2008 October 14th Tuesday (十月 十四日 火曜日)
- 2008 October 21th Tuesday (十月 二十一日 火曜日)
- 2008 October 28th Tuesday (十月 二十八日 火曜日)
- June 9th Tuesday (六月 九日 火曜日)
- 2008 September 9th Tuesday (九月 九日 火曜日)
- October 13th Tuesday
- October 15th Tuesday
- October 22th Tuesday
- October 27th Tuesday
- October 8th Monday (十月 八日 月曜日)
- October 10th Wednesday (十月 十日 水曜日)
- October 11th Thursday (十月 十一日 木曜日)
- October 17th Wednesday (十月 十七日 水曜日)
- October 15th Monday (十月 十五日 月曜日)
- cisco笔试题
- 浮点数计算精度控制
- SQL中获取指定两个日期时间点或者时间段内所有记录语句
- October 8th Monday (十月 八日 月曜日)
- 透视新版QQ登陆方式
- October 9th Tuesday (十月 九日 火曜日)
- J2EE学习笔记一:相关概念和基础知识
- “QQ大盗”采用HOOK技术窃取QQ帐号信息
- utf8字符编码格式转换gbk
- October 10th Wednesday (十月 十日 水曜日)
- 小技巧: 实用的一行 Linux 命令
- Spread For .net WinForm中如何实现多列的ComboBox
- Email存被窃危险 谁来管理加密决策?
- October 11th Thursday (十月 十一日 木曜日)