I've created MacroContext and SyntaxRulesMacro as classes to encapsulate the macro-expansion-time lexical information tracking and syntax-rules macro implementation, respectively.
Many of the actual functions used lies in macro_engine.hpp, though, so be aware.
The two classes and many of the functions have been manually tested, but not turned into unit tests.
I have tested the following:
regular define forms
lambda-like define forms
set! forms
lambda forms
quote forms.
let-syntax and define-syntax forms are to be filled in once the SyntaxRulesMacro class and functionality is filled out in the future.
Note: the (define (foo x y) ...) form appears to be working correctly -- I have implemented some basic re-writing functionality for it, provided that define is put into the HeapVirtualMachine's environment as PrimitiveFormMarker("define"). This is new functionality.
Please check to see that the functions provided are robust for correctly assembling the correct identifier bindings with their sets of scopes.
Please check that the only unit test case given is working correctly. You may want to uncomment the many std::cout statements if you want to see debugging output.
I've created
MacroContext
andSyntaxRulesMacro
as classes to encapsulate the macro-expansion-time lexical information tracking and syntax-rules macro implementation, respectively.Many of the actual functions used lies in
macro_engine.hpp
, though, so be aware.The two classes and many of the functions have been manually tested, but not turned into unit tests.
I have tested the following:
define
formsdefine
formsset!
formslambda
formsquote
forms.let-syntax
anddefine-syntax
forms are to be filled in once the SyntaxRulesMacro class and functionality is filled out in the future.Note: the
(define (foo x y) ...)
form appears to be working correctly -- I have implemented some basic re-writing functionality for it, provided thatdefine
is put into the HeapVirtualMachine's environment asPrimitiveFormMarker("define")
. This is new functionality.Please check to see that the functions provided are robust for correctly assembling the correct identifier bindings with their sets of scopes.
Please check that the only unit test case given is working correctly. You may want to uncomment the many
std::cout
statements if you want to see debugging output.