In First-class Macros Have Types, POPL 2000, Alan Bawden describes a way to make macros behave as first class values.
In modern Scheme, a macro captures the lexical environment where it is defined. This creates an opportunity for extending Scheme so that macros are first-class values. The key to achieving this goal, while preserving the ability to compile programs into reasonable code, is the addition of a type system. Many interesting things can be done with first-class macros, including the construction of a useful module system in which modules are also first-class.
Bawden points out that while he used a static type system...
[t]here is no fundamental reason why this macro type system needs to be static. The same safety could be achieved using dynamic typing....The compiler would emit code to check the tags at runtime to make sure that a value used as an operator always had the type that the programmer promised the compiler it would have.
Recent comments
24 weeks 4 days ago
24 weeks 4 days ago
24 weeks 4 days ago
46 weeks 5 days ago
51 weeks 14 hours ago
1 year 3 days ago
1 year 3 days ago
1 year 3 weeks ago
1 year 7 weeks ago
1 year 7 weeks ago