[previous] [up] [next]     [index]
Next: Match: match.ss Up: MzLib Libraries Previous: Invoking with Exports to

Macros: macro.ss

Files: macro.ss



(class-asi superclass clauses tex2html_wrap_inline100181 ) SYNTAX

Like class, but the initialization arguments are automatically passed on to the superclass initialization procedure.



(class*-asi superclass interfaces clauses tex2html_wrap_inline100181 ) SYNTAX

Like class*, but the initialization arguments are automatically passed on to the superclass initialization procedure.



(evcase key-expr (value-expr body-expr tex2html_wrap_inline100181 ) tex2html_wrap_inline100183 ) SYNTAX

The evcase form is similar to case, except that expressions are provided in each clause instead of a sequence of data. After key-expr is evaluated, each value-expr is evaluated until a value is found that is eqv? to the key value; when a matching value is found, the corresponding body-exprs are evaluated and the value(s) for the last is the result of the entire evcase expression.

A value-expr can be the special identifier else. This identifier is recognized as in case (see section 3.2).



(let+ clause body-expr tex2html_wrap_inline100183 ) SYNTAX

A new binding construct that specifies scoping on a per-binding basis instead of a per-expression basis. It helps eliminate rightward-drift in programs. It looks a lot like let, except each clause has an additional keyword tag before the binding variables.

Each clause has one of the following forms:

The clauses bind left-to-right. Each variable above can either be an identifier or (values variable tex2html_wrap_inline100181 ). In the latter case, multiple values returned by the corresponding expression are bound to the multiple variables.

Examples:

  (let+ ([val (values x y) (values 1 2)]) 
     (list x y)) ; => (1 2) 
  (let ([x 1])
     (let+ ([val x 3] 
            [val y x])
        y)) ; => 3 



(local (definition tex2html_wrap_inline100181 ) body-expr tex2html_wrap_inline100183 ) SYNTAX

This is a binding form similar to letrec, except that each definition is a define-values, define, or define-struct expression (before macro-expansion). The body-exprs are evaluated in the lexical scope of these definitions.



(nand expr tex2html_wrap_inline100181 ) SYNTAX

Returns (not (and expr tex2html_wrap_inline100181 )).



(nor expr tex2html_wrap_inline100181 ) SYNTAX

Returns (not (or expr tex2html_wrap_inline100181 )).



(opt-lambda formals body-expr tex2html_wrap_inline100183 ) SYNTAX

The opt-lambda form is like lambda, except that default values are assigned to arguments (C++-style). Default values are defined in the formals list by replacing each variable by [variable default-value-expression]. If an variable has a default value expression, then all (non-aggregate) variables after it must have default value expressions. A final aggregate variable can be used as in lambda, but it cannot be given a default value. Each default value expression is evaluated only if it is needed. The environment of each default value expression includes the preceding arguments.

For example:

  (define f
     (opt-lambda (a [b (add1 a)] . c)
        ...)) 

Here, f is a procedure which takes at least one argument. If a second argument is specified, it is the value of b, otherwise b is (add1 a). If more than two arguments are specified, then the extra arguments are placed in a new list that is the value of c.



(recur name bindings body-expr tex2html_wrap_inline100183 ) SYNTAX

This is equivalent to a named let: (let name bindings body-expr tex2html_wrap_inline100183 ).



(send* obj msg tex2html_wrap_inline100181 ) SYNTAX

Calls multiple methods of obj (in the specified order). Each msg should have the form:

  (name params ...) 
where name is the method name. For example:
  (send* edit (begin-edit-sequence)
              (insert "Hello")
              (insert #\newline)
              (end-edit-sequence)) 
is the same as
  (let ([e edit])
    (send e begin-edit-sequence)
    (send e insert "Hello")
    (send e insert #\newline)
    (send e end-edit-sequence)) 



(signature->symbols name) SYNTAX

Expands to the ``exploded'' version (see section 7.4.3) of the signature currently bound to name (where name is an unevaluated identifier). The expansion-time value of name (see section 13.3) must have the shape of an exploded signature.


[previous] [up] [next]     [index]
Next: Match: match.ss Up: MzLib Libraries Previous: Invoking with Exports to

PLT