Changeset 39330 in project


Ignore:
Timestamp:
11/21/20 03:34:02 (11 days ago)
Author:
gnosis
Message:

tagged syntax in SRFI-87 documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/srfi-87

    r39329 r39330  
    2424=== Specification
    2525==== (Based on R5RS section 4.2.1 Conditionals)
    26 library syntax: case <key> <clause1> <clause2> ...
     26library syntax:
     27
     28<syntax>case <key> <clause1> <clause2> ...</syntax>
    2729===== Syntax
    2830{{<Key>}} may be any expression. Each {{<clause>}} should have the form
    2931
    30 <enscript highlight="scheme">
    31 ((<datum1> ...) <expression1> <expression2> ...),
    32 </enscript>
     32<syntax>((<datum1> ...) <expression1> <expression2> ...)</syntax>
    3333
    3434where each {{<datum>}} is an external representation of some object. All the {{<datum>}}s must be distinct. The last {{<clause>}} may be an "else clause," which has the form
    3535
    36 <enscript highlight="scheme">
    37 (else <expression1> <expression2> ...).
    38 </enscript>
     36<syntax>(else <expression1> <expression2> ...)</syntax>
    3937
    4038Alternatively, a {{<clause>}} may be of the form
    4139
    42 <enscript highlight="scheme">
    43 ((<datum1> ...) => <expression>)
    44 </enscript>
     40<syntax>((<datum1> ...) => <expression>)</syntax>
    4541
    4642and the last {{<clause>}} may be of the form
    4743
    48 <enscript highlight="scheme">
    49 (else => <expression>)
    50 </enscript>
     44<syntax>(else => <expression>)</syntax>
    5145===== Semantics
    5246A {{case}} expression is evaluated as follows. {{<Key>}} is evaluated and its result is compared against each {{<datum>}}. If the result of evaluating {{<key>}} is equivalent (in the sense of {{eqv?}}; see section see section [[http://www.swiss.ai.mit.edu/~jaffer/r5rs_8.html#SEC49|6.1 Equivalence predicates]]) to a {{<datum>}}, then the expressions in the corresponding {{<clause>}} are evaluated from left to right and the result(s) of the last expression in the {{<clause>}} is(are) returned as the result(s) of the {{case}} expression. If the result of evaluating {{<key>}} is different from every {{<datum>}}, then if there is an else clause its expressions are evaluated and the result(s) of the last is(are) the result(s) of the {{case}} expression; otherwise the result of the {{case}} expression is unspecified. If the selected {{<clause>}} 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 {{<Key>}} and the value(s) returned by this procedure is(are) returned by the {{case}} expression.
Note: See TracChangeset for help on using the changeset viewer.