<div dir="ltr">The reason I didn't do that is very much related to lines 1967-1983 in your diff. <div><br></div><div style>That isn't a good idea: what you really want to do there is check to see if different patterns generate the same languages or not. But that's not something that is easily done (I'm guessing it is computable, but very very expensive. It may not be computable, tho, for all I know.)</div>
<div style><br></div><div style>One could allow unioning by just keeping all productions, and I guess I wouldn't mind an extension to define-union-language via a keyword that did that, tho.</div><div style><br></div><div style>
In your case, is there not a way to refactor your grammars so that you don't need this capability? Could you maybe make a small, representative example to post to the list? I find that kind of thing to be quite helpful for me to understand what the best change to Redex is.</div>
<div style><br>Robby</div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 28, 2013 at 1:46 PM, William J. Bowman <span dir="ltr"><<a href="mailto:wjb@williamjbowman.com" target="_blank">wjb@williamjbowman.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello all,<br>
<br>
I've been hacking on some languages in Redex, and found myself<br>
abstracting commons parts into base languages, and gradually building new<br>
languages via `define-extended-language' and `define-union-language'.<br>
Unfortunately, I hit a wall when I discovered `define-union-language'<br>
doesn't like to union languages that define the same nonterminals.<br>
<br>
Consider this toy example: <a href="https://gist.github.com/bluephoenix47/5054403" target="_blank">https://gist.github.com/bluephoenix47/5054403</a><br>
<br>
This seems like a sensible thing to want to do, so I forked racket wrote a patch:<br>
<a href="https://github.com/bluephoenix47/racket/commit/0a7781b2be2643778f8d8d10d771ab1ce2dc622b" target="_blank">https://github.com/bluephoenix47/racket/commit/0a7781b2be2643778f8d8d10d771ab1ce2dc622b</a><br>
<br>
Unfortunately, several Redex tests fail (<a href="http://sprunge.us/fPHU" target="_blank">http://sprunge.us/fPHU</a>) because<br>
they expect an error when languages which define the same nonterminals<br>
are used in `define-union-language'.<br>
<br>
Is this *desired* behavior? If so, why? It seems very reasonable to want<br>
to merge the nonterminals of languages.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
<br>
William J. Bowman<br>
</font></span><br>_________________________<br>
Racket Developers list:<br>
<a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
<br></blockquote></div><br></div>