Beyond the veil: What's after type functions
Jacob Carlborg
doob at me.com
Wed Jan 6 17:51:46 UTC 2021
On 2021-01-06 17:58, Paul Backus wrote:
> You don't need a stable AST API for AST macros, you just need
> quasi-quoting and unquoting, à la Common Lisp. There's an old talk by
> Walter and Andrei that includes a sketch of what AST macros might look
> like in D [1], which contains the following example:
>
> macro foo(e) { e = 3; }
>
> In Common Lisp, the equivalent would be
>
> (defmacro foo (e) `(setf ,e 3))
>
> You will notice that nowhere in either example is the AST exposed directly.
>
> [1] https://www.youtube.com/watch?v=FRfTk44nuWE&t=1h5m37s
Yes. Here's my suggestion [1] and bottom of [2].
[1] https://wiki.dlang.org/DIP50#Quasi-Quoting
[2] https://forum.dlang.org/post/rt4df4$2n8g$1@digitalmars.com
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list