Next Previous Up Top Contents Index

1 Conventions in this Manual

1.7 Macros that expand into calls to advertised functions

Many macros that take a "body" argument expand into a call to an advertised function that takes a functional argument. This functional argument will execute the supplied body. For a macro named with-environment, the function is generally named do-with-environment. For example, with-drawing-options might be defined as follows:

define macro with-drawing-options
  { with-drawing-options 
    (?medium:name, #rest ?keys:*) ?body:body end }
      => { begin
             let with-drawing-options-body = 
               method (?medium) ?body end;
             do-with-drawing-options(?medium, 
               with-drawing-options-body, ?keys)
           end }
end macro;

define method do-with-drawing-options (medium :: <medium>, function, #rest options) apply(merge-drawing-options-into-medium, medium, options); function(medium) end;


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index