Example: TWICE
Takes any number of forms and evaluates them all once and then all again.
> (define-macro (twice . forms)
(append '(begin) forms forms) )
> (twice (display "Macros are powerful")
(newline)
(display "Aren’t they?")
(newline) )
Macros are powerful
Aren’t they?
Macros are powerful
Aren’t they?
Previous slide
Next slide
Back to first slide
View graphic version