March 20th Tuesday (三月 二十日 火曜日)

  A cond expression is evaluated by evaluating the <test> expressions of successive <clause>s in
order until one of them evaluates to a true value.  When a htesti evaluates to a true value, then
the remaining hexpressionis in its hclausei are evaluated in order,and the result(s) of the last
<expression> in the hclausei is(are) returned as the result(s) of the entire cond expression.  If
the selected hclausei contains only the htesti and no hexpressionis, then the value of the htesti
is returned as the result.  If the selected hclausei uses the => alternate form, then the <expression>
is evaluated. Its value must be a procedure that accepts one argument; this procedure is then called
on the value of the htesti and the value(s) returned by this procedure is(are) returned by the cond
expression.  If all htestis evaluate to false values, and there is no else clause, then the result of
the conditional expression is the unspecified value; if there is an else clause, then its expression
(is) are evaluated, and the value(s) of the last one is(are) returned.

  (and <test1> . . . )

  Syntax: The <test>s must be expressions.

  Semantics: The <test> expressions are evaluated from left to right, and the value of the first
 expression that evaluates to a false value is returned. Any remaining expressions are not evaluated.
 If all the expressions evaluate to true values, the value of the last expression is returned.  If
there are no expressions then #t is returned.


  (letrec <bindings> <body>)
<Bindings> must have the form
((<variable1> <init1>) . . . )

  The <variable>s are bound to fresh locations, the hinitis are evaluated in the resulting environment
 (in some unspecified order), each <variable> is assigned to the result of the corresponding <init>,
 the <body> is evaluated in the resulting environment, and the value(s) of the last expression in
<body> is(are) returned.  Each binding of a <variable> has the entire letrec expression as its region,
making it possible to define mutually recursive procedures.

  One restriction on letrec is very important: it must be possible to evaluate each <init> without
 assigning or referring to the value of any hvariablei.  If this restriction is violated, an exception
with condition type &assertion is raised. The restriction is necessary because Scheme passes arguments
by value rather than by name.  In the most common uses of letrec, all the hinitis are lambda
expressions and the restriction is satisfied automatically.

  (letrec* <bindings> <body>)

  One restriction on letrec* is very important: it must be possible to evaluate each <init> without
assigning or referring to the value the corresponding <variable> or the <variable> of any of the
 bindings that follow it in <bindings>.  If this restriction is violated, an exception with condition
type &assertion is raised.  The restriction is necessary because Scheme passes arguments by value
rather than by name.

  Of the equivalence predicates described in this section, eq? is the finest or most discriminating,
and equal? is the coarsest.  The eqv? predicate is slightly less discriminating than eq?.

  The equal? predicate returns #t if and only if the (possibly infinite) unfoldings of its arguments
into regular trees are equal as ordered trees.

  The equal? predicate treats pairs and vectors as nodes with outgoing edges, uses string=? to compare strings, uses bytesvector=? to compare bytevectors, and uses eqv? to compare other nodes. 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值