opMixin or mixin function templates with convenience operator?
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Fri Dec 13 16:44:17 UTC 2019
On Friday, 13 December 2019 at 16:07:01 UTC, Paul Backus wrote:
> You'll notice that there's no direct manipulation of the
> AST--everything is done by substitution.
Yes, and there are many ways to do substitution.
Full term rewriting is extremely powerful, to the extent that it
is used for formal proofs and verifiable programming. That is
going a bit far.
On the other end of the spectrum you have very limited pattern
matching languages like XSLT that compensate for the simplicity
by providing entrypoints for scripting (javascript).
So it is possible that something like XSLT (substitution) with
CTFE where XSLT use javascript could work.
Pattern matching transforms with some CTFE mixed in can provide
elegant AST manipulation. In my experience it leads to code that
is relatively easy to read and understand and feels familiar for
people with FP background.
More information about the Digitalmars-d
mailing list