Skip to main content

max / quasi

846 B · 30 lines History Blame Raw
1 //! An include of a shape that made no promise, with nothing to vary.
2 //!
3 //! The arguments are literal, so there is nothing here a request decides, and
4 //! the caller rewrites the call to the callee's `#[constant]` shim. `label`
5 //! made no such promise, so there is no shim and the call does not resolve.
6 //!
7 //! That refusal is the whole enforcement. A proc macro sees one invocation and
8 //! no other, so the caller cannot read the callee's flags; inlining on the
9 //! shape of the arguments alone would bake one evaluation of a shape that reads
10 //! a clock into a residual and serve it forever.
11
12 use quasi_declare::declare;
13
14 declare! {
15 pub shape label(text: &str) -> Node;
16
17 text text;
18 }
19
20 declare! {
21 #[staged]
22 pub shape panel() -> Node;
23
24 region "panel" as Pane {
25 include label("written down");
26 }
27 }
28
29 fn main() {}
30