This may be a somewhat niche request, but hopefully it's just a special case of a common need.
I have multiple files, say V1 and V2, that each provide the same surface language constructs – e.g., #%app, some macros, some functions — but of course implemented in different ways. I also have additional files, say V21 and V22, that need to extend the common language of V1/2 in a consistent way (e.g., add a few more macros and functions that both V21 and V22 provide).
By default, I can only identify missing things through tests. I would like to statically ensure that I have provided the same interfaces, and ideally describe the delta between V21/22 and V1/2 (rather than copy the description of V1/2 into V21/22).
Essentially, I want to describe the grammar in one place, à la BNF, including the names of primitives and such. Note that I want a specification of the language, separate from its implementation (since I'd also like to generate a Web page giving that spec).
There's define-syntax-class for creating new classes for use in a syntax-parser. I suppose I could create a rather complex syntax class that represents the whole language; presumably I would then apply to this to the entire body through module-begin (and to REPL instructions via top-interaction)?
Has anyone done something like this and would care to share an example?
Thanks!
Shriram