Le mardi 26 mai 2020 21:41:14 UTC+2, Sam Tobin-Hochstadt a écrit :
>
> I think the best way to implement what you describe for a "better 
> version" is as follows: 
>
> Expand `(instance h1 half-adder-arch)` into something like 
>
>   (define-syntax h1 (half-adder-arch-info)) 
>

I have seen this done somewhere else.
At the time, I found that it looked more like a hack to work around the 
limitations of syntax objects (compared to the model-drive approach).

But I also understand that it can be a flexible way to organize the 
expansion-time data that we need without creating a complete object graph.
I will have a closer look at this pattern.

This paper: https://arxiv.org/abs/1106.2578 talks about this technique 
> in more detail, focused on the implementation of `match-expander`s, 
> which work this way, but it's a common Racket technique and used for 
> structs, syntax classes, `for` transformers, and more. 
>

Thanks for the reference.
I will have a look at it in the next few days.

Guillaume

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/db346484-27a5-493a-872b-835207595211%40googlegroups.com.

Reply via email to