On wto, 2017-06-06 at 19:39 +0200, Michał Górny wrote: > On wto, 2017-06-06 at 14:08 +0200, Alexis Ballier wrote: > > On Mon, 05 Jun 2017 20:10:12 +0200 > > Michał Górny <mgo...@gentoo.org> wrote: > > [...] > > > > > Stand-alone makes little sense (and little trouble) but as you > > > > > could have seen it's used nested in other thingies: > > > > > > > > > > 1. || ( ( a b ) ( c d ) e ) > > > > > > > > > > 2. ?? ( ( a b ) ( c d ) e ) > > > > > > > > > > 3. ^^ ( ( a b ) ( c d ) e ) > > > > > > > > Yeah that's the nesting problem causing a parse error. > > > > Those should be expanded to implications. What I'm relying onto is > > > > all clauses to be of the form '[list of conditions]? [list of > > > > constraints]' > > > > > > I've noticed that you turned the implications into multi-conditions, > > > breaking all my scripts ;-). Is the [list of conditions] conjunctive > > > or disjunctive? > > > > conjunctive as in foo? ( bar? ( baz ) ) -> [foo,bar]?[baz] > > Yeah, I guess that's useful. I didn't do that originally because I > wanted the AST to be fully compatible with REQUIRED_USE in Gentoo. But I > guess it doesn't hurt, and makes a lot of the code simpler. > > I've backported this change and adjusted all the remaining modules to > work with it correctly. > > > > > [...] > > > > > The question is whether we want to: > > > > > > > > > > a. actually try to solve this nesting insanity, > > > > > > > > > > b. declare it unsupported and throw REQUIRED_USE mismatch on user, > > > > > > > > > > c. ban it altogether. > > > > > > > > > > > > I don't think it is *that* insane to support nesting :) > > > > > > > > > ( ^^ ( ?? ( a b ) c ( d e ) ) f ) > > > > If you really need that then you'd need to expand it manually. It seems > > better to have it expanded internally automatically. > > Remember you were the one wanting to keep || & co because they're > > simpler to read and write ;) > > > > Well, I was able to implement the logic for all-of blocks outside > and inside other n-ary constraints, including the necessary logic > transformations. Fun fact is, I was able to do it without implementing > a complete set of logic functions and transformations in AST ;-). > > I've just made it fail (correctly this time) with any other kind of > nesting -- I don't think it's going to have a real use case and even if > it did, there are more readable ways of solving the same problem. > > The question is -- will you rebase now on top of my changes > (and preferably use nice logical changes with good commit messages), > or should I try later to merge the rest of your code in? ;-) >
I've rebased your changes and pushed them. However, I didn't alter replace_nary to include '!a...' since it made the results worse for me... it's possible that I did it wrong. There's also some issue with all-of expressions that exhibits itself on ibus. I'll look at that later. -- Best regards, Michał Górny
signature.asc
Description: This is a digitally signed message part