Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

macrolet

macrolet

type: special form (fsubr)
location: built-in
source file: xlcont.c
Common LISP compatible: yes
supported on: all machines

SYNTAX

(macrolet  ( [ <macro> ... ]  ) <expr> ... )
        <macro>         -       a macro definition binding which is of the 
                                form  ( <symbol> <arg-list> <body> )
        <symbol>        -       the symbol specifying the function name
        <arg-list>      -       the argument list for the function 
        <body>          -       the body of the function
        <expr>          -       an expression

DESCRIPTION

The MACROLET special form is basically a local block construct that allows local <macro> definitions followed by a block of code to evaluate. The first form after the macrolet is the 'binding' form. It contains a series of <macro>s. The MACROLET form will sequentially execute the <expr>'s after defining the <macro>s. The value of the last <expr> evaluated is returned. When the MACROLET is finished execution, the <symbol>'s that were defined will no longer exist.

EXAMPLES

                                        ; a MACROLET form including
(macrolet ((pls (n1 n2) `(+ ,n1 ,n2)))  ;  PLS macro
  (pls 4 5))                            ;  returns 9
                                        ; the PLS macro no longer exists
(pls 4 5)                               ; error: unbound function - PLS
                                        ;
                                        ; an empty MACROLET
(macrolet () (print 'a))                ; prints A


Go to the first, previous, next, last section, table of contents.