Title: How to Write Seemingly Unhygienic and Referentially Opaque Macros with Syntax-rules
Summary: This paper talks about how to write seemingly unhygienic and referentially opaque macros in R5RS. In particular, section 1 introduces the concept of macro and the standardized R5RS that is reliable. R5RS, however, is only restricted in a pattern language, syntax-rules. In order to obtain R5RS's latent power, Petrofsky introduced a general technology, Petrofsky extraction of writing macros
that can extract a speci c binding from their arguments. Section 2 introduces the concept of hygiene and referential transparency of macro expansion. It uses an example of macro expansion that avoids inadvertent captures of free variables through systematic renaming by defining colors. Section 3 briefly introduces Petrofsky extraction in the previous example by changing mbi to mbi-i. Section 4 obtains referential opaqueness by defining customized mylet form in macro expansion. However, the mylet form is not supported in R5RS and can not handle nest expansion. As such, section 5 further achieves referential opaqueness in R5RS.
Things I understood well: I understand the concepts of section 1, the definition of colors, the basic idea of Petrofsky extraction and the way to achieve referential opaqueness in this paper.
Things I have trouble understanding: had trouble in understanding the syntax rules of section 3 and 5.
Title: A Few Principles of Macro Design
Summary: This paper describes the introspective power of macros. In particular, section 2 uses an example of compile-time predicate to prove that a hygienic macro system of syntax-rules can also produce ill-conceived macros. Section 3 then compares hygienic macros to fexprs in two aspects: compiler and programmer. Hygienic macros is not as troublesome as fexprs. Finally, section 4 gives several principles for macro design, including: designing macros with \alpha equivalence, using identifiers consistently, avoiding observing variable names and treating subterm as atomic.
Things I understood well: understood the example and the comparison between hygienic macro and fexprs.
Things I have trouble understanding: I am quite clear about \alpha equivalence.