
"Eric Niebler" <eric@boost-consulting.com> wrote in message news:40C3684F.6040000@boost-consulting.com... | | Gregory Colvin wrote: [snip] | > *x = *y [snip] | I thought about this. I wasn't sure how well it would be received. | People would have to write their grammars like: | | rule<> a, b; | *a = parser >> that >> refers >> to >> b; | *b = parser >> that >> refers >> to >> a; [snip] | That's why I have been | considering this: | | rule<> a, b; | a *= parser >> that >> refers >> to >> b; | b *= parser >> that >> refers >> to >> a; maybe rule<> a, b; a = parser >> that >> refers >> to >> b; b = parser >> that >> refers >> to >> a; a = a.clone(); ? | I don't know. Another question is: would spirit's users accept any | amount of syntactic/conceptual overhead to have a rule with standard | copy semantics and that was able to track its references and avoid | cyclic dependencies? I'm not an expert spirit user, but the current semantics already carries some conceptual overhead with it. Anything that can reduce surprises would help. And I can replace this code template< int > rule<>& some_rule(...) { static rule<> r = ...; return r; } rule<> r1 = some_rule<1>(...) rule<> r2 = some_rule<2>(...) with rule<> some_rule(...) { return ...; } rule<> r1 = some_rule(...) rule<> r2 = some_rule(...) br Thorsten